updates
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index f4e696c..7726b35 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,25 +1,25 @@
-# This workflow will build and deploy new versions of DTPS
-
-name: deploy
-
-on:
- push:
- branches: [ main ]
-
-jobs:
- deploy:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Use Node.js 12.x
- uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - run: |
- git config user.name github-actions
- git config user.email [email protected]
- git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- - run: npm ci
- - run: npm run deploy --if-present
+# This workflow will build and deploy new versions of DTPS
+
+name: deploy
+
+on:
+ push:
+ branches: [ main ]
+
+jobs:
+ deploy:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js 12.x
+ uses: actions/setup-node@v1
+ with:
+ node-version: '12.x'
+ - run: |
+ git config user.name github-actions
+ git config user.email [email protected]
+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
+ - run: npm ci
+ - run: npm run deploy --if-present
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 2ee1c3d..e8375cc 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -1,38 +1,38 @@
-# This workflow will build and deploy new development versions of DTPS
-
-name: dev
-
-on:
- push:
- branches: [ dev ]
-
-jobs:
- dev:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Use Node.js 12.x
- uses: actions/setup-node@v1
- with:
- node-version: '12.x'
-
- - name: Configure git
- env:
- SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- run: |
- mkdir -p ~/.ssh
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- ssh-agent -a $SSH_AUTH_SOCK > /dev/null
- ssh-add - <<< "${{ secrets.DTPS_DEV_PRIVATE_KEY }}"
- git config user.name github-actions
- git config user.email [email protected]
-
- - name: Run npm scripts
- env:
- SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- run: |
- npm ci
- npm run dev --if-present
+# This workflow will build and deploy new development versions of DTPS
+
+name: dev
+
+on:
+ push:
+ branches: [ dev ]
+
+jobs:
+ dev:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Use Node.js 12.x
+ uses: actions/setup-node@v1
+ with:
+ node-version: '12.x'
+
+ - name: Configure git
+ env:
+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
+ run: |
+ mkdir -p ~/.ssh
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
+ ssh-agent -a $SSH_AUTH_SOCK > /dev/null
+ ssh-add - <<< "${{ secrets.DTPS_DEV_PRIVATE_KEY }}"
+ git config user.name github-actions
+ git config user.email [email protected]
+
+ - name: Run npm scripts
+ env:
+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
+ run: |
+ npm ci
+ npm run dev --if-present
diff --git a/.gitignore b/.gitignore
index 17ec2b8..858caed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-node_modules
-build
+node_modules
+build
chrome/chrome.zip
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6e568b8..4347077 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,34 +1,34 @@
-# Contributing
-
-Before adding new features or making major changes, please open an issue or contact me at [[email protected]](mailto:[email protected]).
-
-## Documentation
-
-You can read the Power+ docs at [powerplus.app/docs](https://powerplus.app/docs).
-
-## Code Organization
-
-- `/scripts` Power+ script files
-- `/scripts/lms` LMS integration files
-- `/www` Static website files
-- `/docs` JSDoc configuration
-- `/chrome` Chrome extension source
-- `/build` Public website and optimized JavaScript files generated by `npm run build`
-
-## Development Environment
-
-To get Power+ up and running locally, you'll need git and node installed on your system.
-
-```bash
-git clone https://github.com/jottocraft/dtps.git dtps
-cd dtps
-npm install
-npm start
-```
-
-When the server is ready, open Power+ and go to Settings -> About -> Show Advanced Options -> Test prerelease versions. Then, reload Power+ and go to Settings -> Prerelease testing and select "Local". This will make Power+ load from the local server instead of the live version the next time you reload.
-
-## NPM scripts
-- `start` Starts an HTTP server for testing Power+ locally
-- `build` Minifies Power+ and generates docs into the build folder for deployment
-- `deploy` Runs the build script, then deploys Power+ to the gh-pages branch for hosting
+# Contributing
+
+Before adding new features or making major changes, please open an issue or contact me at [[email protected]](mailto:[email protected]).
+
+## Documentation
+
+You can read the Power+ docs at [powerplus.app/docs](https://powerplus.app/docs).
+
+## Code Organization
+
+- `/scripts` Power+ script files
+- `/scripts/lms` LMS integration files
+- `/www` Static website files
+- `/docs` JSDoc configuration
+- `/chrome` Chrome extension source
+- `/build` Public website and optimized JavaScript files generated by `npm run build`
+
+## Development Environment
+
+To get Power+ up and running locally, you'll need git and node installed on your system.
+
+```bash
+git clone https://github.com/jottocraft/dtps.git dtps
+cd dtps
+npm install
+npm start
+```
+
+When the server is ready, open Power+ and go to Settings -> About -> Show Advanced Options -> Test prerelease versions. Then, reload Power+ and go to Settings -> Prerelease testing and select "Local". This will make Power+ load from the local server instead of the live version the next time you reload.
+
+## NPM scripts
+- `start` Starts an HTTP server for testing Power+ locally
+- `build` Minifies Power+ and generates docs into the build folder for deployment
+- `deploy` Runs the build script, then deploys Power+ to the gh-pages branch for hosting
diff --git a/LICENSE b/LICENSE
index d159169..89e08fb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,339 +1,339 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/README.md b/README.md
index fb5f3fe..1ae9a00 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,39 @@
-<p align="center">
- <img width="320" src="https://i.imgur.com/upFXZF4.png" />
-</p>
-
-<br />
-
-<p align="center">
- <a href="https://github.com/jottocraft/dtps/releases/latest"><img src="https://img.shields.io/github/release/jottocraft/dtps.svg" /></a>
- <a href="https://powerplus.app"><img src="https://img.shields.io/website/https/powerplus.app.svg?label=server%20status" /></a>
- <a href="https://github.com/jottocraft/dtps/actions?query=workflow%3Adeploy"><img src="https://github.com/jottocraft/dtps/workflows/deploy/badge.svg" /></a>
- <a href="https://github.com/jottocraft/dtps/actions?query=workflow%3Adev"><img src="https://github.com/jottocraft/dtps/workflows/dev/badge.svg" /></a>
- <a href="https://powerplus.app/docs"><img src="http://inch-ci.org/github/jottocraft/dtps.svg?branch=main&style=shields" /></a>
-</p>
-
-<p align="center">
-For users looking to install Power+, visit the Power+ website by clicking <a href="https://powerplus.app/?install=true">here</a>
-</p>
-
-<br /><br />
-
-## Resources
-
-- [Documentation](https://powerplus.app/docs/)
-- [Contributing](CONTRIBUTING.md)
-
-## Bookmarklet
-If you cannot use the Power+ [Chrome Extension](https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo), you can add the bookmarklet below to access Power+. Once the bookmarklet is added, open Canvas, then click the bookmarklet to load Power+.
-
-<br />
-
-Stable bookmarklet
-
-```javascript
-javascript:!function(){window.dtpsBaseURL="https://powerplus.app",window.dtpsLoader=3;var d=document.createElement("script");d.src=window.dtpsBaseURL+"/init.js",document.head.appendChild(d)}();
-```
-
-<br /><br /><br /><br /><br /><br />
-
-(c) 2018-2020 jottocraft [license](https://github.com/jottocraft/dtps/blob/main/LICENSE)
+<p align="center">
+ <img width="320" src="https://i.imgur.com/upFXZF4.png" />
+</p>
+
+<br />
+
+<p align="center">
+ <a href="https://github.com/jottocraft/dtps/releases/latest"><img src="https://img.shields.io/github/release/jottocraft/dtps.svg" /></a>
+ <a href="https://powerplus.app"><img src="https://img.shields.io/website/https/powerplus.app.svg?label=server%20status" /></a>
+ <a href="https://github.com/jottocraft/dtps/actions?query=workflow%3Adeploy"><img src="https://github.com/jottocraft/dtps/workflows/deploy/badge.svg" /></a>
+ <a href="https://github.com/jottocraft/dtps/actions?query=workflow%3Adev"><img src="https://github.com/jottocraft/dtps/workflows/dev/badge.svg" /></a>
+ <a href="https://powerplus.app/docs"><img src="http://inch-ci.org/github/jottocraft/dtps.svg?branch=main&style=shields" /></a>
+</p>
+
+<p align="center">
+For users looking to install Power+, visit the Power+ website by clicking <a href="https://powerplus.app/?install=true">here</a>
+</p>
+
+<br /><br />
+
+## Resources
+
+- [Documentation](https://powerplus.app/docs/)
+- [Contributing](CONTRIBUTING.md)
+
+## Bookmarklet
+If you cannot use the Power+ [Chrome Extension](https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo), you can add the bookmarklet below to access Power+. Once the bookmarklet is added, open Canvas, then click the bookmarklet to load Power+.
+
+<br />
+
+Stable bookmarklet
+
+```javascript
+javascript:!function(){window.dtpsBaseURL="https://powerplus.app",window.dtpsLoader=3;var d=document.createElement("script");d.src=window.dtpsBaseURL+"/init.js",document.head.appendChild(d)}();
+```
+
+<br /><br /><br /><br /><br /><br />
+
+(c) 2018-2020 jottocraft [license](https://github.com/jottocraft/dtps/blob/main/LICENSE)
diff --git a/build.js b/build.js
index a31f78d..6993246 100644
--- a/build.js
+++ b/build.js
@@ -1,130 +1,130 @@
-/**
- * @file DTPS predeploy script
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- *
- * This script file minifies DTPS and generates docs
- */
-
-//Import modules
-const { minify } = require("terser");
-
-const { exec } = require("child_process");
-const fs = require("fs");
-const path = require("path");
-
-const glob = require("glob");
-const mkdirp = require('mkdirp');
-const rimraf = require("rimraf");
-const ncp = require('ncp').ncp;
-const dev = process.argv.includes("--dev");
-
-//Delete existing build folder
-rimraf.sync("./build/*");
-
-//Run functions
-if (dev) {
- console.log("\n[1/3] Skipping minification (dev)");
- copyStatic();
-} else {
- minifyJS();
-}
-
-//[1/3] Minify JavaScript
-function minifyJS() {
- console.log("\n[1/3] Minifying JavaScript...");
-
- //Minify files function
- async function minifyFile(filePath) {
- //Run terser
- var results = await minify({
- [filePath]: fs.readFileSync(filePath, "utf8")
- }, {
- sourceMap: {
- url: "/" + filePath + ".map",
- includeSources: true,
- root: "/"
- }
- });
-
- //Make parent folder
- mkdirp.sync(path.join("build", filePath, ".."));
-
- //Write output files
- fs.writeFileSync(path.join("build", filePath), results.code, "utf8");
- fs.writeFileSync(path.join("build", filePath + ".map"), results.map, "utf8");
- }
-
- //Minify files
- minifyFile("init.js");
- glob.sync("scripts/**/*.js").forEach(file => {
- minifyFile(file);
- });
-
- console.log("[1/3] Done");
- copyStatic();
-}
-
-//[2/3] Copy static files
-function copyStatic() {
- console.log("\n[2/3] Copying static files...");
-
- //Make build folder if it doesn't already exist
- mkdirp.sync("build");
-
- //Copy dtps.css
- fs.copyFileSync("dtps.css", "build/dtps.css");
-
- //Write CNAME
- fs.writeFileSync(path.join("build", "CNAME"), dev ? "dev.dtps.jottocraft.com" : "powerplus.app", "utf8");
-
- //Copy www
- ncp("www", "build", function () {
- if (dev) {
- //Copy dev assets
- ncp("www/dev", "build", function () {
- //Copy JS without minification
- fs.copyFileSync("init.js", "build/init.js");
- ncp("scripts", "build/scripts", function () {
- console.log("[2/3] Done");
- generateDocs();
- });
- });
- } else {
- //Remove dev assets for stable build
- rimraf.sync("./build/dev/*");
-
- console.log("[2/3] Done");
- generateDocs();
- }
- });
-}
-
-//[3/3] Generate documentation
-function generateDocs() {
- console.log("\n[3/3] Generating documentation...");
-
- //Make build folder if it doesn't already exist
- mkdirp.sync("./build/docs");
-
- //Generate docs
- var docConf = "./docs/jsdoc.conf.json";
- if (dev) docConf = "./docs/jsdoc.dev.conf.json";
-
- var cp = exec("node ./node_modules/jsdoc/jsdoc.js -r scripts -d ./build/docs -c " + docConf + " -t ./node_modules/foodoc/template -R ./docs/README.md", function (e, o) {
- if (e) console.error(e);
- if (o) console.log(o);
- });
-
- //Listen for exit
- cp.addListener("close", function () {
- console.log("[3/3] Done");
- finish();
- });
-}
-
-function finish() {
- console.log("\nAll build tasks have finished");
+/**
+ * @file DTPS predeploy script
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ *
+ * This script file minifies DTPS and generates docs
+ */
+
+//Import modules
+const { minify } = require("terser");
+
+const { exec } = require("child_process");
+const fs = require("fs");
+const path = require("path");
+
+const glob = require("glob");
+const mkdirp = require('mkdirp');
+const rimraf = require("rimraf");
+const ncp = require('ncp').ncp;
+const dev = process.argv.includes("--dev");
+
+//Delete existing build folder
+rimraf.sync("./build/*");
+
+//Run functions
+if (dev) {
+ console.log("\n[1/3] Skipping minification (dev)");
+ copyStatic();
+} else {
+ minifyJS();
+}
+
+//[1/3] Minify JavaScript
+function minifyJS() {
+ console.log("\n[1/3] Minifying JavaScript...");
+
+ //Minify files function
+ async function minifyFile(filePath) {
+ //Run terser
+ var results = await minify({
+ [filePath]: fs.readFileSync(filePath, "utf8")
+ }, {
+ sourceMap: {
+ url: "/" + filePath + ".map",
+ includeSources: true,
+ root: "/"
+ }
+ });
+
+ //Make parent folder
+ mkdirp.sync(path.join("build", filePath, ".."));
+
+ //Write output files
+ fs.writeFileSync(path.join("build", filePath), results.code, "utf8");
+ fs.writeFileSync(path.join("build", filePath + ".map"), results.map, "utf8");
+ }
+
+ //Minify files
+ minifyFile("init.js");
+ glob.sync("scripts/**/*.js").forEach(file => {
+ minifyFile(file);
+ });
+
+ console.log("[1/3] Done");
+ copyStatic();
+}
+
+//[2/3] Copy static files
+function copyStatic() {
+ console.log("\n[2/3] Copying static files...");
+
+ //Make build folder if it doesn't already exist
+ mkdirp.sync("build");
+
+ //Copy dtps.css
+ fs.copyFileSync("dtps.css", "build/dtps.css");
+
+ //Write CNAME
+ fs.writeFileSync(path.join("build", "CNAME"), dev ? "dev.dtps.jottocraft.com" : "powerplus.app", "utf8");
+
+ //Copy www
+ ncp("www", "build", function () {
+ if (dev) {
+ //Copy dev assets
+ ncp("www/dev", "build", function () {
+ //Copy JS without minification
+ fs.copyFileSync("init.js", "build/init.js");
+ ncp("scripts", "build/scripts", function () {
+ console.log("[2/3] Done");
+ generateDocs();
+ });
+ });
+ } else {
+ //Remove dev assets for stable build
+ rimraf.sync("./build/dev/*");
+
+ console.log("[2/3] Done");
+ generateDocs();
+ }
+ });
+}
+
+//[3/3] Generate documentation
+function generateDocs() {
+ console.log("\n[3/3] Generating documentation...");
+
+ //Make build folder if it doesn't already exist
+ mkdirp.sync("./build/docs");
+
+ //Generate docs
+ var docConf = "./docs/jsdoc.conf.json";
+ if (dev) docConf = "./docs/jsdoc.dev.conf.json";
+
+ var cp = exec("node ./node_modules/jsdoc/jsdoc.js -r scripts -d ./build/docs -c " + docConf + " -t ./node_modules/foodoc/template -R ./docs/README.md", function (e, o) {
+ if (e) console.error(e);
+ if (o) console.log(o);
+ });
+
+ //Listen for exit
+ cp.addListener("close", function () {
+ console.log("[3/3] Done");
+ finish();
+ });
+}
+
+function finish() {
+ console.log("\nAll build tasks have finished");
}
\ No newline at end of file
diff --git a/chrome/background.js b/chrome/background.js
index 229f066..118014f 100644
--- a/chrome/background.js
+++ b/chrome/background.js
@@ -1,5 +1,5 @@
-chrome.runtime.onMessage.addListener(function (message) {
- if (message.messageName == 'extensionUninstall') {
- chrome.management.uninstallSelf();
- }
+chrome.runtime.onMessage.addListener(function (message) {
+ if (message.messageName == 'extensionUninstall') {
+ chrome.management.uninstallSelf();
+ }
});
\ No newline at end of file
diff --git a/chrome/communicator.js b/chrome/communicator.js
index 9a2bd95..2a08a23 100644
--- a/chrome/communicator.js
+++ b/chrome/communicator.js
@@ -4,7 +4,7 @@
addedNodes.forEach(node => {
//Power+ button
if (node.nodeType === 1 && node.id == "dtpsInstallBtn") {
- node.setAttribute("onclick", "window.location.href = 'https://dtechhs.instructure.com/power+'");
+ node.setAttribute("onclick", "window.location.href = 'https://dtechhs.instructure.com/power+/'");
node.innerHTML = `<i class="material-icons">open_in_new</i> Open`;
}
})
@@ -16,7 +16,7 @@
childList: true,
subtree: true
})
-} else if (window.location.pathname == "/power+") {
+} else if ((window.location.pathname == "/power+") || (window.location.pathname == "/power+/")) {
//Check for light or dark theme
var light = false;
if (window.localStorage.fluidTheme == "light") {
@@ -133,7 +133,7 @@
} else if (window.location.search.includes("dtpsLogin=true")) {
//redirect to Power+ after login
console.log("[DTPS Chrome] Redirecting after login...");
- window.location.href = "/power+";
+ window.location.href = "/power+/";
} else {
var releaseType = null;
if (window.localStorage.dtpsLoaderPref == "dev") releaseType = "Power+ (dev)";
@@ -148,7 +148,7 @@
if (node.nodeType === 1 && node.id == "menu") {
node.insertAdjacentHTML("beforeend", /*html*/`
<li class="menu-item ic-app-header__menu-list-item ">
- <a id="global_nav_dtps_link" role="button" href="/power+" class="ic-app-header__menu-list-link">
+ <a id="global_nav_dtps_link" role="button" href="/power+/" class="ic-app-header__menu-list-link">
<div class="menu-item-icon-container" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="ic-icon-svg ic-icon-svg--dtps" version="1.1" viewBox="0 0 48 63.999"><path d="m5.333 0c-2.946 0-5.333 2.4-5.333 5.333v48c0 2.933 2.388 5.333 5.333 5.333h5.333v5.333l6.667-5.333 6.667 5.333v-5.333h18.667c2.947 0 5.333-2.4 5.333-5.333v-2.667c0 2.933-2.387 5.333-5.333 5.333h-18.667v-5.333h-13.333v5.333h-4c-2.209 0-4-1.867-4-4 0-2.4 1.791-4 4-4h36c2.947 0 5.333-2.4 5.333-5.333v-37.333c0-2.933-2.387-5.333-5.333-5.333h-37.333z"/></svg>
</div>
diff --git a/chrome/manifest.json b/chrome/manifest.json
index 200d27c..9d5e15d 100644
--- a/chrome/manifest.json
+++ b/chrome/manifest.json
@@ -1,23 +1,23 @@
-{
- "manifest_version": 2,
-
- "name": "Power+",
- "description": "A better UI for Canvas LMS",
- "version": "3.0.5",
- "background": {
- "scripts": ["background.js"]
- },
- "content_scripts": [
- {
- "run_at": "document_start",
- "matches": ["https://*.instructure.com/*", "https://powerplus.app/"],
- "js": ["communicator.js"]
- }
- ],
- "icons": {
- "16": "16.png",
- "32": "32.png",
- "48": "48.png",
- "128": "128.png"
- }
-}
+{
+ "manifest_version": 2,
+
+ "name": "Power+",
+ "description": "A better UI for Canvas LMS",
+ "version": "3.0.6",
+ "background": {
+ "scripts": ["background.js"]
+ },
+ "content_scripts": [
+ {
+ "run_at": "document_start",
+ "matches": ["https://*.instructure.com/*", "https://powerplus.app/"],
+ "js": ["communicator.js"]
+ }
+ ],
+ "icons": {
+ "16": "16.png",
+ "32": "32.png",
+ "48": "48.png",
+ "128": "128.png"
+ }
+}
diff --git a/chrome/promo1.png b/chrome/promo1.png
index 8da83b0..347b361 100644
--- a/chrome/promo1.png
+++ b/chrome/promo1.png
Binary files differ
diff --git a/chrome/promo2.png b/chrome/promo2.png
index 1f0a76c..51d3b88 100644
--- a/chrome/promo2.png
+++ b/chrome/promo2.png
Binary files differ
diff --git a/chrome/promo3.png b/chrome/promo3.png
index 9538990..addc039 100644
--- a/chrome/promo3.png
+++ b/chrome/promo3.png
Binary files differ
diff --git a/chrome/promo4.png b/chrome/promo4.png
new file mode 100644
index 0000000..0548c1b
--- /dev/null
+++ b/chrome/promo4.png
Binary files differ
diff --git a/chrome/promo5.png b/chrome/promo5.png
new file mode 100644
index 0000000..cebadf9
--- /dev/null
+++ b/chrome/promo5.png
Binary files differ
diff --git a/docs/README.md b/docs/README.md
index 84776e8..faef171 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,6 +1,6 @@
-This website includes reference documentation for the latest version of Power+
-
-### Resources
-- [GitHub](https://github.com/jottocraft/dtps)
-- [Contributing](https://github.com/jottocraft/dtps/blob/main/CONTRIBUTING.md)
+This website includes reference documentation for the latest version of Power+
+
+### Resources
+- [GitHub](https://github.com/jottocraft/dtps)
+- [Contributing](https://github.com/jottocraft/dtps/blob/main/CONTRIBUTING.md)
- [Power+ website](https://powerplus.app)
\ No newline at end of file
diff --git a/docs/jsdoc.conf.json b/docs/jsdoc.conf.json
index 81d5531..5288a16 100644
--- a/docs/jsdoc.conf.json
+++ b/docs/jsdoc.conf.json
@@ -1,13 +1,13 @@
-{
- "sourceType": "script",
- "templates": {
- "systemName": "Power+ Docs",
- "systemSummary": "Reference documentation for the latest version of Power+",
- "systemLogo": "./www/favicon.png",
- "systemColor": "#c5982f",
- "copyright": "(c) 2018-2020 jottocraft. All rights reserved.",
- "favicon": "./www/favicon.png",
- "collapseSymbols": false,
- "footer": "<img style='height: 32px; margin: 10px 0px;' src='https://cdn.jottocraft.com/images/footerImage.png' />"
- }
+{
+ "sourceType": "script",
+ "templates": {
+ "systemName": "Power+ Docs",
+ "systemSummary": "Reference documentation for the latest version of Power+",
+ "systemLogo": "./www/favicon.png",
+ "systemColor": "#c5982f",
+ "copyright": "(c) 2018-2020 jottocraft. All rights reserved.",
+ "favicon": "./www/favicon.png",
+ "collapseSymbols": false,
+ "footer": "<img style='height: 32px; margin: 10px 0px;' src='https://cdn.jottocraft.com/images/footerImage.png' />"
+ }
}
\ No newline at end of file
diff --git a/docs/jsdoc.dev.conf.json b/docs/jsdoc.dev.conf.json
index 0fe5da9..d3c4252 100644
--- a/docs/jsdoc.dev.conf.json
+++ b/docs/jsdoc.dev.conf.json
@@ -1,13 +1,13 @@
-{
- "sourceType": "script",
- "templates": {
- "systemName": "Power+ (dev)",
- "systemSummary": "Reference documentation for the latest version of Power+ (dev)",
- "systemLogo": "./www/dev/favicon.png",
- "systemColor": "#c5982f",
- "copyright": "(c) 2018-2020 jottocraft. All rights reserved.",
- "favicon": "./www/dev/favicon.png",
- "collapseSymbols": false,
- "footer": "<img style='height: 32px; margin: 10px 0px;' src='https://cdn.jottocraft.com/images/footerImage.png' />"
- }
+{
+ "sourceType": "script",
+ "templates": {
+ "systemName": "Power+ (dev)",
+ "systemSummary": "Reference documentation for the latest version of Power+ (dev)",
+ "systemLogo": "./www/dev/favicon.png",
+ "systemColor": "#c5982f",
+ "copyright": "(c) 2018-2020 jottocraft. All rights reserved.",
+ "favicon": "./www/dev/favicon.png",
+ "collapseSymbols": false,
+ "footer": "<img style='height: 32px; margin: 10px 0px;' src='https://cdn.jottocraft.com/images/footerImage.png' />"
+ }
}
\ No newline at end of file
diff --git a/dtps.css b/dtps.css
index 1645592..4788e10 100644
--- a/dtps.css
+++ b/dtps.css
@@ -1,1736 +1,1713 @@
-/*
-Power+ CSS
-(c) jottocraft 2018-2020
-*/
-
-[data-theme-type=light] {
- --theme: #ccac56 !important;
- --themeText: #ffffff !important;
-}
-
-[data-theme-type=dark] {
- --theme: #8c793e !important;
- --themeText: #ffffff !important;
-}
-
-.dashboardItem {
- text-align: center;
- padding: 20px;
- border-radius: 10px;
- border: 2px solid var(--elements);
- background: var(--cards);
- cursor: move;
- margin: 10px;
- user-select: none;
- display: flex;
- flex-direction: column;
- justify-content: center;
-}
-
-.dashboardColumn {
- vertical-align: top;
- display: inline-block;
- width: calc(50% - 20px);
- margin: 0px 5px;
- min-height: 100px;
- padding-bottom: 100px;
- padding-top: 25px;
-}
-
-.dashboardItem h5 span {
- font-size: 20px;
- font-weight: bold;
- vertical-align: middle;
-}
-
-.dashboardItem i {
- vertical-align: middle;
-}
-
-.dashboardItem .compactModeSwitch {
- cursor: auto;
- margin-top: 20px;
-}
-
-.dashboardItem .compactModeSwitch .switch {
- text-align: left;
-}
-
-.btns.tabs .btn {
- transition: color 0.4s, font-size 0.4s !important;
-}
-
-.welcomeSection {
- margin: 50px 0px;
-}
-
-.welcomeSection h5 {
- font-weight: bold;
- font-size: 22px;
- margin: 0px;
- vertical-align: middle;
- display: inline-block;
-}
-
-.welcomeSection i {
- vertical-align: middle;
- margin-right: 5px;
-}
-
-.welcomeSection p {
- color: var(--lightText);
-}
-
-.dtpsSubmissionComment {
- margin: 32px 12px;
-}
-
-.dtpsSubmissionComment img {
- width: 34px;
- border-radius: 50%;
- vertical-align: middle;
-}
-
-.dtpsSubmissionComment h5 {
- display: inline-block;
- vertical-align: middle;
- margin-left: 5px;
- font-size: 17px;
- color: var(--lightText);
-}
-
-.dtpsAssignmentRubricItem {
- margin: 32px 12px;
- padding: 20px;
- border-radius: 15px;
- box-shadow: var(--lightShadow);
- background: var(--elements);
-}
-
-.dtpsAssignmentRubricItem:nth-child(1), .dtpsSubmissionComment:nth-child(1) {
- margin-top: 12px;
-}
-
-.dtpsAssignmentRubricItem h5 {
- font-size: 20px;
- margin: 0px;
- margin-bottom: 10px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.dtpsAssignmentRubricItem .score p {
- display: inline-block;
- margin: 0px;
-}
-
-.dtpsAssignmentRubricItem .score .scoreName {
- font-size: 16px;
- vertical-align: middle;
- font-weight: bold;
-}
-
-.dtpsAssignmentRubricItem .score .points {
- float: right;
- vertical-align: middle;
- display: inline-block;
-}
-
-.dtpsAssignmentRubricItem .score .points .earned {
- font-size: 22px;
- font-weight: bold;
-}
-
-.dtpsAssignmentRubricItem .score .points .possible {
- opacity: 0.5;
- font-size: 12px;
- vertical-align: bottom;
-}
-
-.dtpsRubricScore {
- height: 24px;
- display: inline-block;
-}
-
-.dtpsRubricScore div {
- display: inline-block;
- font-size: 14px;
- height: 24px;
- line-height: 24px;
- font-weight: bold;
-}
-
-.discussionHeader {
- margin: 12px 0px;
- margin-bottom: 20px;
-}
-
-.discussionHeader h5 {
- display: inline-block;
- vertical-align: middle;
- color: var(--lightText);
- font-size: 18px;
- margin: 0px;
-}
-
-.discussionHeader img {
- width: 28px;
- vertical-align: middle;
- border-radius: 50%;
- margin-right: 5px;
-}
-
-.discussionHeader i {
- color: var(--secText);
- vertical-align: middle;
- margin-left: 20px;
- font-size: 16px;
-}
-
-.discussionHeader span {
- color: var(--secText);
- vertical-align: middle;
- margin-left: 5px;
- font-size: 14px;
-}
-
-.discussionFooter {
- margin-top: 22px;
-}
-
-.discussionReply {
- border-left: 2px solid var(--elementHover);
- padding: 10px 0px;
- padding-left: 30px;
-}
-
-.discussionReply h5 {
- font-size: 18px;
- color: var(--lightText);
-}
-
-.dash .colorBar {
- width: 7px;
- height: calc(100% - 32px);
- position: absolute;
- top: 16px;
- left: 14px;
- border-radius: 10px;
- display: block !important;
-}
-
-.dash .colorBar {
- background: var(--classColor);
-}
-
-.colorBar {
- display: none;
-}
-
-.announcement .className {
- color: var(--classColor);
- font-weight: bold;
- font-size: 16px;
-}
-
-
-.assessmentWrapper.dropped span.assessmentTitle, .assessmentWrapper.dropped .editableScore:not(.focused) {
- opacity: 0.4;
-}
-
-.assessmentWrapper.dropped span.assessmentTitle {
- text-decoration: line-through;
-}
-
-.assessmentWrapper span.assessmentTitle {
- transition: opacity 0.2s;
-}
-
-/* POWERPOINTS THEME */
-body.darkPowerpoints, body.showThemeWindows .themeWindow.darkPowerpoints {
- --flex-light: #b39a46; --flex-bg: #a78e3a; --flex-text: #ffffff; --flex-sectext: #e4d8ae; --flex-layer1: #867027; --flex-layer2: #726021; --flex-layer3: #5f4f1c; --theme-color: #6d6d6d; --theme-text-color: #b39a46; --links: #686868; --acrylic: black; }
-
-.recentGrade.card {
- padding: 20px;
- cursor: pointer;
-}
-
-.recentGrade h5 {
- color: var(--classColor);
- display: flex;
- justify-content: space-between;
- margin: 0px;
- font-size: 18px;
-}
-
-.recentGrade h5 span {
- font-weight: bold;
- display: inline-block;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-}
-
-.recentGrade p {
- margin: 0px;
- margin-top: 7px;
- color: var(--secText);
-}
-
-.numFont {
- font-family: Cascadia Code,Consolas,Andale Mono WT,Andale Mono,Lucida Console,Lucida Sans Typewriter,DejaVu Sans Mono,Bitstream Vera Sans Mono,Liberation Mono,Nimbus Mono L,Monaco,Courier New,Courier,monospace !important;
-}
-
-.classContent .card.collapsed {
- padding: 10px 20px;
-}
-
-.classContent .card.collapsed h4 {
- font-size: 18px !important;
- font-weight: normal !important;
-}
-
-.classContent .card.collapsed h4 i {
- margin-top: -3px;
-}
-
-.classContent .card.collapsed .moduleContents {
- display: none;
-}
-
-.classGradeCircle {
- display: inline-block;
- height: 60px;
- font-size: 40px;
- text-align: right;
- line-height: 60px;
- border-radius: 50%;
- float: right;
- vertical-align: middle;
-}
-
-.classGradeCircle .percentage {
- color: var(--lightText);
- font-size: 20px;
- font-weight: bold;
- vertical-align: middle;
- margin-right: 20px;
-}
-
-.classGradeCircle .letter {
- color: var(--classColor);
- font-weight: bold;
- vertical-align: middle;
- width: 110px;
- text-align: center;
- display: inline-block;
-}
-
-.gradeStat {
- height: 60px;
- line-height: 60px;
- color: var(--lightText);
- font-size: 24px;
- margin: 0px;
-}
-
-.smallStat {
- height: 40px;
- line-height: 40px;
- color: var(--secText);
- font-size: 20px;
- margin: 5px 0px;
-}
-
-.gradeStat .numFont, .smallStat .numFont {
- display: inline-block;
- width: 110px;
- text-align: center;
- height: 60px;
- line-height: 60px;
- border-radius: 50%;
- float: right;
- vertical-align: middle;
- font-size: 26px;
- color: var(--text);
- font-weight: bold;
-}
-
-.smallStat .numFont {
- height: 40px;
- line-height: 40px;
- font-size: 18px;
- color: var(--lightText);
-}
-
-.numFont.fraction {
- font-size: 0px;
-}
-
-.numFont .earned {
- font-weight: bold;
- font-size: 14px;
-}
-
-.numFont .total {
- color: var(--secText);
- font-size: 12px;
-}
-
-.gradeTitle {
- margin-bottom: 10px;
- height: 60px;
- line-height: 60px;
- margin-top: 0px;
- font-weight: bold;
- font-size: 36px;
-}
-
-.infoChip {
- vertical-align: middle;
- margin: 0px 5px;
- display: inline-block;
- font-size: 14px;
- height: 20px;
- line-height: 20px;
- color: var(--lightText);
-}
-
-.infoChip:nth-child(1) {
- margin-left: 0px;
-}
-
-.assignmentChip {
- padding: 5px 10px;
- display: inline-block;
- border-radius: 20px;
- line-height: 24px;
- margin: 0px 2px;
- color: var(--lightText);
- vertical-align: middle;
-}
-
-.assignmentChip i {
- vertical-align: middle;
-}
-
-.assignmentChip span {
- margin-left: 7px;
- vertical-align: middle;
-}
-
-.progressBar {
- padding: 5px;
- background-color: var(--elements);
- border-radius: 12px;
- height: 30px;
- margin: 10px 5px;
- cursor: pointer;
-}
-
-.progressLabel {
- position: absolute;
- z-index: 5;
- color: var(--themeText);
-}
-
-.progressBar .progress {
- height: 32px;
- background-color: var(--theme);
- margin: -6px;
- border-radius: 12px;
- position: absolute;
-}
-
-.progressBar.big {
- height: 50px;
- padding: 10px;
-}
-
-.progressBar.big .progressLabel {
- height: 32px;
- line-height: 32px;
- font-size: 18px;
-}
-
-.progressBar.big .progress {
- height: 42px;
-}
-
-.infoChip i {
- vertical-align: middle;
- font-size: 18px;
-}
-
-.dash.cal .card {
- margin: 25px;
- width: 100%;
-}
-
-#id_email, #id_name {
- display: none !important;
-}
-
-body.darkDtech {
- --flex-light: #bb4a2d; --flex-bg: #a73a21; --flex-text: white; --flex-sectext: #ffb6a3; --flex-layer1: #da5332; --flex-layer2: #923923; --flex-layer3: #6f2715; --theme-color: #f2896f; --theme-color-outline: rgb(242, 137, 111, 0.75); --theme-text-color: #af4125; }
-
-.dash.cal .announcement {
- margin-right: 0px;
-}
-
-body.isolatedGoogleClass .header .btns {
- display: none !important;
-}
-
-body.isolatedGoogleClass .background {
- background: linear-gradient(to right bottom, rgb(177, 168, 35), rgb(8, 101, 59)) !important;
-}
-
-.announcement:not(.open) {
- max-height: 200px;
-}
-
-.announcement {
- overflow: hidden;
-}
-
-body {
- position: relative;
- height: 100%;
- min-height: 100vh;
-}
-
-.sidenav .item {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.sidenav .item i {
- margin-right: 10px;
-}
-
-.class.whatif .letter {
- display: none;
-}
-
-.class.whatif .points {
- display: inline !important;
-}
-
-.label i {
- vertical-align: middle;
-}
-
-.search, .classContent i.inputIcon {
- margin: 15px 75px 0px 10px !important;
-}
-
-.dash.stream .search, .classContent .dash.stream i.inputIcon {
- margin: 15px 25px 0px 10px !important;
-}
-
-.classContent .assignmentPicker .btn.active {
- background: #7b7b7b45 !important;
- color: inherit !important;
-}
-
-.class.active .dot {
- background-color: var(--dark);
- color: white;
-}
-
-body.dark .card .dot {
- background-color: #181b1d;
-}
-
-body.titlebar .sidebar {
- position: fixed;
- top: 75;
-}
-
-.sidebar .item:not(.active) {
- filter: none !important;
-}
-
-body.dark .sidebar .item:not(.active) {
- filter: brightness(1.2) !important;
-}
-
-.sidebar .item .label {
- max-width: calc(100% - 32px);
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.classDivider {
- display: inline-block;
- width: 250px;
- height: 2px;
- border-radius: 10px;
- background-color: transparent;
- margin: 15px 0;
-}
-
-.sidebar .item .grade {
- text-align: center;
- width: 22px;
- font-size: 18px;
- font-family: var(--textFont);
- font-weight: bold;
-}
-
-.hidegrades .sidebar .item .grade {
- visibility: hidden !important;
- width: 0px;
-}
-
-.class .icon {
- font-size: 20px;
- font-weight: bold;
- height: 24px;
- line-height: 24px;
-}
-
-.class.main:not(.active) {
- color: var(--lightText) !important;
- border-color: var(--secText) !important;
-}
-
-body.dark .class.main:not(.active), body.dark .class.overrideClass:not(.active) {
- color: #ffffffbf !important;
- border-color: #ffffff36 !important;
-}
-
-.class:not(.main):not(.active) {
- color: var(--classColor);
-}
-
-.class:not(.main).active {
- background-color: var(--classColor) !important;
- color: white !important;
-}
-
-.sidebar, .abtheader {
- background-color: var(--nav);
-}
-
-body.noSidebar .sidebar {
- display: none;
- visibility: hidden;
-}
-
-body.noSidebar .header {
- width: 100%;
- margin-left: 0px;
-}
-
-body.titlebar .background, body.titlebar .cover.image {
- position: fixed;
- height: 75px;
- z-index: 10;
-}
-
-.sticky {
- position: fixed;
- top: 0;
- width: 100%;
-}
-
-body.titlebar .header {
- padding: 0px;
- z-index: 10;
- text-align: left;
-}
-
-body.titlebar .classContent {
- z-index: 1;
- padding-top: 100px;
-}
-
-body.noSidebar .classContent {
- margin-left: 0px;
- width: 100%;
-}
-
-body.titlebar .header h1 {
- font-size: 40px;
- line-height: 75px;
- display: inline-block;
- margin: 0px;
- margin-left: 25px;
- position: fixed;
- left: 0px;
- z-index: 200;
-}
-
-body.titlebar .header .btns {
- margin-top: 30px;
- position: fixed;
- margin-left: calc(50% - 175px)
-}
-
-body.titlebar:not(.noSidebar) .header .btns {
- margin-left: calc(50% - 525px);
-}
-
-.classContent {
- z-index: 100;
- top: 0;
-}
-
-.tabs.btns {
- padding: 0px;
- background-color: transparent !important;
-}
-
-.tabs.btns .btn {
- border: none !important;
- background-color: transparent !important;
- box-shadow: none !important;
- color: var(--text);
- border-radius: 0px !important;
- font-size: 15px;
- border-bottom: 2px solid transparent !important;
- transition: color 0.2s, border-color 0.2s !important;
- opacity: 0.5;
- font-weight: normal;
-}
-
-.tabs.btns .btn.active {
- border-color: var(--text) !important;
- font-weight: bold;
- opacity: 1;
-}
-
-.tabs.btns .btn i {
- font-size: 24px;
-}
-
-.sidebar, .header {
- transition: all 0.5s;
-}
-
-.dot {
- display: none;
-}
-
-.background, .cover.image {
- position: absolute;
- top: 0;
- width: 100%;
- height: 500px;
- opacity: 0.2;
-}
-
-.background {
- filter: blur(10px);
-}
-
-.header {
- margin-left: 275px;
- text-align: center;
- padding-top: 132px;
- z-index: 200;
- position: absolute;
- top: 0;
- width: calc(100% - 275px);
-}
-
-.classContent .card {
- margin: 12px 20px;
- text-align: left;
- border-radius: 25px;
-}
-
-.classContent .card {
- color: var(--text);
-}
-
-.card:not(.alert) i.close {
- position: absolute;
- right: 0;
- cursor: pointer;
- top: 0;
- margin: 25px;
-}
-
-.spinner {
- width: 40px;
- height: 40px;
- margin: 40px auto;
- background-color: var(--secText);
- border-radius: 100%;
- -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
- animation: sk-scaleout 1.0s infinite ease-in-out;
-}
-
-@-webkit-keyframes sk-scaleout {
- 0% {
- -webkit-transform: scale(0)
- }
-
- 100% {
- -webkit-transform: scale(1.0);
- opacity: 0;
- }
-}
-
-@keyframes sk-scaleout {
- 0% {
- -webkit-transform: scale(0);
- transform: scale(0);
- }
-
- 100% {
- -webkit-transform: scale(1.0);
- transform: scale(1.0);
- opacity: 0;
- }
-}
-
-.classContent .card .points {
- display: inline-block;
- white-space: nowrap;
- overflow: hidden;
- height: 24px;
- flex-shrink: 0;
-}
-
-.classContent .points.spinner {
- top: 25px;
- margin-top: 0px;
-}
-
-.classContent .points .earned {
- font-size: 24px;
- display: inline-block;
- font-weight: bold;
-}
-
-.classContent .points .total {
- font-size: 14px;
- display: inline-block;
- color: var(--secText);
-}
-
-.classContent .assignment:not(.color) .points .total, .assignment:not(.color) .weighted {
- color: var(--secText);
-}
-
-.assignment .weighted {
- color: var(--secText);
- font-size: 0.82rem;
-}
-
-.assignment .weighted i {
- font-size: 16px !important;
- margin-top: -3px;
-}
-
-.weight.parent .weight {
- padding: 10px !important;
- overflow: auto;
- margin: 10px 75px !important;
- transition: height 0.4s;
-}
-
-.weight.parent .weight.open {
- height: 400px !important;
-}
-
-.weight.parent .weight:not(.open) .open, .weight.parent .weight.open .close {
- display: none !important;
-}
-
-.weight .close p {
- margin: 0px !important;
- cursor: pointer;
-}
-
-.weight.parent .weight h4 {
- cursor: pointer;
-}
-
-.weight.parent .weight p {
- color: gray !important;
-}
-
-.weight.parent .weight:not(.open) {
- overflow: hidden !important;
-}
-
-.badge i {
- vertical-align: middle;
- font-size: 20px;
-}
-
-.dash.stream .card {
- margin-right: 25px;
-}
-
-.badge.missing {
- color: #b7630a;
- border-color: #b7630a;
-}
-
-.weight.parent {
- padding: 0px !important;
- overflow: visible;
- margin-bottom: 100px;
-}
-
-.card .weight p {
- color: var(--secText) !important;
-}
-
-.card.gb {
- padding: 0 !important;
-}
-
-.dash .card .points .total {
- color: var(--classColor);
-}
-
-.dash .card .floatingIcon {
- color: var(--classColor) !important;
-}
-
-.card.details fieldset, .card.details #tb_handin_link, .card.details div.p, .card.details label {
- display: none;
-}
-
-.assignment {
- cursor: pointer;
- padding: 15px 18px;
- position: relative;
- border-radius: var(--cardRadius);
- border: 2px solid transparent;
- transition: border 0.2s, background-color 0.2s;
- user-select: none;
-}
-
-.assignment:hover {
- background-color: var(--elements);
- border-color: var(--highlight);
-}
-
-.classContent .assignment h5 {
- margin: 0px;
- margin-top: 6px;
- font-size: 1rem !important;
- min-height: 20px;
- white-space: nowrap;
- overflow: hidden;
- display: flex;
- justify-content: space-between;
-}
-
-.classContent .assignment h5 div {
- display: inline-block;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.classContent .assignment h5 .status {
- flex-shrink: 0;
-}
-
-.classContent .card.assignment h4 {
- font-size: 18px;
- margin: 0px !important;
- white-space: nowrap;
- height: 24px;
- line-height: 24px;
- display: flex;
- justify-content: space-between;
-}
-
-.classContent .card.assignment span {
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.assignment .statusIcon {
- float: right;
- font-size: 16px;
- vertical-align: middle;
-}
-
-.class.active .name {
- font-weight: bold;
-}
-
-body:not(.dark) {
- --light: var(--flex-light, #efefef); --norm: var(--flex-layer1, #929292); --dark: var(--flex-layer3, #5f5f5f); --grad: linear-gradient(to bottom right, var(--cards), var(--background)); }
-
-body.dark {
- --light: var(--flex-light, #949494); --norm: var(--flex-layer1, #444444); --dark: var(--flex-layer3, #292929); --grad: linear-gradient(to bottom right, var(--cards), var(--background)); }
-
-body:not(.dark) .background, body:not(.dark) .header h1 {
- --grad: linear-gradient(to bottom right, var(--elementHover), var(--background)) !important; color: black !important;
-}
-
-#whatIfResults {
- display: none;
- border: 2px solid var(--cards);
- background-color: var(--elements);
- position: fixed;
- top: 0;
- width: 400px;
- z-index: 999 !important;
- padding: 20px;
- margin: 10px;
- box-shadow: 0px 15px 20px rgba(0, 0, 0, 0.51);
-}
-
-#whatIfResults h5 {
- font-weight: bold;
- margin-bottom: 28px;
-}
-
-#whatIfResults .resultLetter {
- color: gray;
- font-weight: bold;
- float: right;
- display: inline-block;
- font-size: 32px;
-}
-
-.assignmentGrade {
- white-space: nowrap;
- overflow: hidden;
- font-size: 0px;
- display: inline-block;
- vertical-align: middle;
-}
-
-.assignmentGrade div {
- display: inline-block;
-}
-
-.assignmentGrade .grade {
- font-weight: bold;
- font-size: 18px;
- color: var(--text);
- vertical-align: bottom;
-}
-
-.assignmentGrade .value {
- font-size: 14px;
- color: var(--secText);
- vertical-align: bottom;
- margin-left: 2px;
-}
-
-.assignmentGrade:not(:hover) .letter, .assignmentGrade:not(:hover) .percentage {
- display: none;
-}
-
-.assignmentGrade:hover .grade, .assignmentGrade:hover .value {
- display: none;
-}
-
-.assignmentGrade .letter {
- font-size: 20px;
- font-weight: bold;
- color: var(--text);
- vertical-align: middle;
-}
-
-.assignmentGrade .percentage {
- font-size: 14px;
- color: var(--secText);
- margin-left: 4px;
- vertical-align: middle;
-}
-
-.gradebookAssignment {
- padding: 15px;
- border-radius: 5px;
- cursor: pointer;
-}
-
-.gradebookAssignment h5 {
- margin: 0px;
- font-size: 18px;
- height: 20px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.gradebookAssignment .stats div {
- display: inline-block;
- vertical-align: middle;
-}
-
-.gradebookAssignment .stats {
- float: right;
- text-align: right;
-}
-
-.gradebookAssignment .gradebookLetter {
- font-weight: bold;
- font-size: 24px;
- width: 50px;
- text-align: center;
- margin-right: 15px;
-}
-
-.gradebookAssignment .gradebookScore {
- font-weight: bold;
- font-size: 20px;
- width: 80px;
- text-align: right;
-}
-
-.gradebookAssignment .gradebookValue {
- color: var(--secText);
- font-size: 16px;
- width: 70px;
- margin-right: 10px;
- text-align: left;
-}
-
-.gradebookAssignment .gradebookPercentage {
- color: var(--lightText);
- font-size: 18px;
- width: 60px;
- text-align: center;
-}
-
-.card.module h4 {
- margin: 0px 2px;
- font-size: 24px;
- font-weight: bold;
-}
-
-.card.module h4 i {
- cursor: pointer;
- vertical-align: middle;
- color: var(--lightText);
-}
-
-.moduleItem {
- color: var(--lightText);
- padding:5px;
- font-size:14px;
- border-radius:15px;
- margin:5px 0;
- cursor: pointer;
-}
-
-.moduleItem i {
- vertical-align: middle;
- margin-right: 4px;
- font-size: 20px;
-}
-
-.background, .cover.image {
- background-size: 100%;
- position: absolute;
- z-index: -90;
-}
-
-.background:before {
- border-radius: inherit;
- background: linear-gradient(to bottom right, var(--classColor), var(--background));
- content: '';
- display: block;
- height: 100%;
- width: 100%;
- position: absolute;
- top: 0;
- left: 0;
- opacity: 0;
- z-index: -100;
- transition: all 0.5s ease-in-out;
-}
-
-body.dashboard .background:before {
- background: var(--grad, linear-gradient(to bottom right, var(--cards), var(--background)));
-}
-
-.cover.image {
- transition: all 0.2s ease-in-out;
-}
-
-.background.trans:before {
- opacity: 1;
- transition: all 0.5s;
-}
-
-.dash .assignment {
- padding-left: 34px;
-}
-
-.dash .weighted {
- color: var(--classColor) !important;
-}
-
-.dash .weighted {
- opacity: 0.7;
-}
-
-body:not(.dev) .dev, body:not(.sudo) .sudo, body:not(.contributor) .contributor, body:not(.prerelease) .prerelease, body:not(.marketer) .marketer {
- display: none !important;
-}
-
-.item.link {
- font-size: 20px;
- cursor: pointer;
- margin-top: 10px;
- padding-left: 10px;
-}
-
-.item.link i {
- vertical-align: middle;
- margin-right: 10px;
-}
-
-.item.link span {
- vertical-align: middle;
-}
-
-.earned.outcomes {
- height: 20px;
- text-align: right;
- writing-mode: vertical-rl;
- line-height: 0px;
- font-size: 0px !important;
- white-space: normal;
-}
-
-.earned.outcomes .outcome {
- background-color: var(--text);
- display: inline-block;
- vertical-align: middle;
- width: 7px;
- height: 7px;
- border-radius: 50%;
- margin: 1px;
-}
-
-.earned.outcomes .outcome.score1 {
- background-color: #b90000;
-}
-
-.earned.outcomes .outcome.score2 {
- background-color: #cc8400;
-}
-
-.earned.outcomes .outcome.score3 {
- background-color: #b5b500;
-}
-
-.earned.outcomes .outcome.score4 {
- background-color: #007700;
-}
-
-#whatIfGrade {
- position: fixed;
- top: 0px;
- margin: 20px;
- border-radius: 15px;
- background-color: var(--elements);
- border: 2px solid var(--secText);
- padding: 20px;
- z-index: 800;
- box-shadow: 0px 0px 20px 10px var(--elements);
-}
-
-#whatIfGrade .letter {
- width: 50px;
- height: 50px;
- background-color: var(--cards);
- font-size: 28px;
- font-weight: bold;
- display: inline-block;
- vertical-align: middle;
- text-align: center;
- line-height: 50px;
- border-radius: 10px;
- margin-right: 12px;
-}
-
-#whatIfGrade .notice {
- display: inline-block;
- vertical-align: middle;
- width: 300px;
-}
-
-#whatIfGrade .notice h5 {
- font-size: 22px;
- margin: 0px;
- font-weight: bold;
-}
-
-#whatIfGrade .notice p {
- font-size: 14px;
- margin: 0px;
- margin-top: 10px;
-}
-
-#whatIfGrade .notice a {
- color: var(--lightText);
-}
-
-.recentChanges .changeName {
- font-size: 20px;
- margin-top: 20px;
- height: 32px;
- line-height: 32px;
-}
-
-.recentChanges i {
- margin-right: 10px;
-}
-
-.recentChanges .letter {
- display: inline-block;
- vertical-align: middle;
- background-color: var(--elements);
- width: 32px;
- height: 32px;
- text-align: center;
- line-height: 32px;
- margin-right: 10px;
- border-radius: 5px;
- font-size: 14px;
- font-weight: bold;
-}
-
-.recentChanges .alignmentChange {
- margin-left: 32px;
- font-size: 14px;
-}
-
-.recentChanges .alignmentChange span {
- font-size: 24px;
- margin-right: 5px;
-}
-
-/* FullCalendar Fluid UI CSS cutomizations v5.3.2 */
-#calendar .fc-toolbar-title {
- font-size: 32px !important;
-}
-
-#calendar .fc-button-primary {
- background: none;
- box-shadow: none;
- border: none;
- color: var(--text);
-}
-
-#calendar td, #calendar th, #calendar .fc-scrollgrid {
- border: none;
-}
-
-#calendar a {
- color: var(--text);
-}
-
-#calendar .fc-event-time {
- display: none;
-}
-
-#calendar .fc-toolbar.fc-header-toolbar {
- margin-bottom: 10px;
-}
-
-#calendar .fc-h-event {
- border: 1px solid transparent;
- cursor: pointer;
-}
-
-#calendar .fc-event-title i {
- color: #c44848;
- font-size: 12px;
- vertical-align: middle;
-}
-
-#calendar .fc-daygrid-day {
- border-radius: 5px;
- transition: background-color 0.4s;
- cursor: pointer;
-}
-
-#calendar .fc-daygrid-day:hover {
- background-color: var(--elements);
-}
-
-#calendar .fc-daygrid-day.active {
- background-color: var(--elementHover);
-}
-
-#calendar .fc-event-title span {
- vertical-align: middle;
-}
-
-#calendar .fc-daygrid-day.fc-day-today {
- background-color: var(--theme);
-}
-
-#calendar.dateSelected .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
- border-radius: 50%;
- background-color: var(--theme);
-}
-
-#calendar.dateSelected .fc-daygrid-day.fc-day-today {
- background-color: transparent;
-}
-
-#calendar .fc-daygrid-day.fc-day-today a {
- color: var(--themeText);
-}
-
-#calendar .fc-scroller-liquid-absolute, #calendar .fc-view-harness-active>.fc-view {
- position: relative;
-}
-
-#calendar .fc-view-harness {
- height: auto !important;
-}
-
-#calendar .fc-col-header, #calendar .fc-daygrid-body, #calendar .fc-daygrid-body>table {
- width: 100% !important;
-}
-
-#calendar .fc-h-event .fc-event-title {
- font-size: 12px;
-}
-
-.classToolChip {
- border-radius: 50%;
- height: 40px;
- width: 40px;
- text-align: center;
- display: inline-block;
- vertical-align: middle;
- cursor: pointer;
- margin-right: 3px;
- background-color: var(--elements);
-}
-
-.classToolChip:hover {
- background-color: var(--elementHover);
- transition: background-color 0.2s;
-}
-
-body {
- --cardShadow: 0 5px 15px rgb(0 0 0 / 0.08) !important;
-}
-
-.headerArea {
- margin: 10px 20px;
- width: auto;
- height: 250px;
-}
-
-body.themeImage .headerArea .content {
- background: none !important;
-}
-
-#dtpsUnstable {
- position: absolute;
- color: #ff4e4e;
- cursor: auto;
-}
-
-@media(max-width: 1550px) {
- #dtpsUnstable {
- top: 55px;
- right: 5px;
- }
-}
-
-body:not(.themeImage) .headerArea:not(.classImage) h1 {
- text-shadow: none !important;
-}
-
-body.themeImage .headerArea img {
- display: none !important;
-}
-
-.headerArea img {
- opacity: 0.3;
-}
-
-body.dark .headerArea img {
- opacity: 0.2;
-}
-
-#headText {
- transition: color 0.2s;
- white-space: nowrap;
- max-width: 95%;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#headText span {
- font-weight: bold;
- vertical-align: middle;
-}
-
-#headText i {
- margin-right: 5px;
- vertical-align: middle;
- font-size: 36px;
-}
-
-.gradeSummaryShowHide {
- margin: 10px 0px;
- cursor: pointer;
- text-align: center;
-}
-
-.gradeSummaryShowHide i, .gradeSummaryShowHide span {
- vertical-align: middle;
-}
-
-.gradeSummaryShowHide i {
- margin-right: 5px;
-}
-
-#classGradeMore {
- margin: 0px 20px;
- padding: 20px;
-}
-
-.block.status .bottom {
- font-size: 18px;
-}
-
-.block .previousGrade {
- font-size: 14px;
- opacity: 0.5;
- position: absolute;
- top: 50px;
-}
-
-.fixedGradeSummary #gradeSummary {
- box-shadow: var(--lightShadow);
- left: 275px;
- padding: 20px;
- position: fixed;
- top: 60px;
- z-index: 99;
- width: calc(100% - 275px);
- margin: 0px !important;
- background: var(--navbar);
- backdrop-filter: blur(20px);
-}
-
-body.collapsedSidebar #gradeSummary {
- left: 72px;
- width: calc(100% - 72px);
-}
-
-.classContent.fixedGradeSummary {
- padding-top: 160px;
-}
-
-.block .showActualGrades {
- font-size: 14px;
- position: absolute;
- top: 50px;
- color: var(--secText);
- cursor: pointer;
-}
-
-#classGradeMore .table tr.active {
- background-color: var(--classColor);
-}
-
-#classGradeMore .table tr.active, #classGradeMore .table tr.active * {
- color: white;
- font-weight: bold;
-}
-
-#classGradeMore.whatIf .table tr.active {
- background-color: var(--elements);
-}
-
-#classGradeMore.whatIf .table tr.active, #classGradeMore.whatIf .table tr.active * {
- color: var(--classColor);
-}
-
-.editableScore {
- outline: none;
- font-size: 20px;
- vertical-align: middle;
- display: inline-block;
- padding: 2px 5px;
- border-radius: 5px;
- margin-right: 5px;
- transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
- border: 2px solid transparent;
- width: 45px;
- text-align: center;
-}
-
-.editableScore.modified, .editableScore.focused, .editableScore:hover {
- background-color: var(--inputColor);
- border-color: var(--elements);
-}
-
-.teacherName {
- color: var(--text);
- font-size: 18px;
-}
-
-.teacherImage {
- margin-right: 4px;
- height: 32px;
- width: 32px;
- border-radius: 50%;
- background-position: center;
- background-repeat: no-repeat;
- background-size: cover;
- background-color: var(--elements);
- vertical-align: middle;
-}
-
-#dtpsSearchResults {
- position: fixed;
- z-index: 100;
- width: 500px;
- top: 70px;
- left: calc(50% - 250px);
- box-shadow: 0px 0px 20px rgb(0 0 0 / 0.5);
- border: 2px solid var(--elements);
-}
-
-#dtpsSearchResults h5 {
- margin-top: 0px;
-}
-
-#dtpsSearchResults h5 i {
- vertical-align: middle;
-}
-
-#dtpsSearchResults h5 span {
- font-size: 18px;
- font-weight: bold;
- vertical-align: middle;
-}
-
-#settingsReloadWarning {
- background: var(--elements);
- border-radius: var(--elementRadius);
- padding: 15px 18px;
- box-shadow: var(--elementShadow);
- margin: 24px 0px;
-}
-
-.card.searchResult {
- padding: 15px 18px;
- position: relative;
- border-radius: var(--cardRadius);
- border: 2px solid transparent;
- cursor: pointer;
- transition: border 0.2s, background-color 0.2s;
- user-select: none;
-}
-
-.card.searchResult h4 {
- font-size: 20px;
- margin: 0px !important;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- height: 24px;
- line-height: 24px;
- font-weight: bold;
-}
-
-.card.searchResult h5 {
- margin: 0px;
-}
-
-.card.searchResult .highlight {
- font-weight: bold;
- background-color: var(--theme);
- color: var(--themeText);
-}
-
-.card.searchResult .highlight i {
- color: var(--themeText) !important;
- font-weight: bold !important;
-}
-
-.card.searchResult .statusIcon {
- font-size: 18px;
- color: var(--secText);
-}
-
-.searchResult.mixedClasses .colorBar {
- width: 7px;
- height: calc(100% - 32px);
- position: absolute;
- top: 16px;
- left: 14px;
- border-radius: 10px;
- display: block !important;
-}
-
-.searchResult.mixedClasses .colorBar {
- background: var(--classColor);
-}
-
-.searchResult.mixedClasses {
- padding-left: 34px;
-}
-
-.searchResult:hover {
- background-color: var(--elements);
- border-color: var(--highlight);
-}
-
-#searchFilterContainer {
- width: 400px;
- display: inline-block;
- vertical-align: top;
-}
-
-#searchFilterContainer .card {
- margin-right: 10px;
-}
-
-#searchResultsContainer.withFilters {
- margin-left: 0px;
- width: calc(100% - 410px);
- display: inline-block;
-}
-
-#searchResultsContainer.withFilters .card {
- margin-left: 10px;
-}
-
-#searchFilterContainer .card h5 {
- margin-top: 0px;
- font-weight: bold;
-}
-
-#searchFilterContainer .card h5 span {
- vertical-align: middle;
- font-weight: bold;
-}
-
-#searchFilterContainer .card h5 i {
- vertical-align: middle;
- margin-right: 3px;
-}
-
-#searchFilterContainer .card .checkContainer {
- margin: 10px 0px;
-}
-
-.fixedSearchFilters #searchFilterContainer .card {
- top: 60px;
- position: fixed;
- width: 370px;
+/*
+Power+ CSS
+(c) jottocraft 2018-2020
+*/
+
+[data-theme-type=light] {
+ --theme: #ccac56 !important;
+ --themeText: #ffffff !important;
+}
+
+[data-theme-type=dark] {
+ --theme: #8c793e !important;
+ --themeText: #ffffff !important;
+}
+
+.dashboardItem {
+ text-align: center;
+ padding: 20px;
+ border-radius: 10px;
+ border: 2px solid var(--elements);
+ background: var(--cards);
+ cursor: move;
+ margin: 10px;
+ user-select: none;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+}
+
+.dashboardColumn {
+ vertical-align: top;
+ display: inline-block;
+ width: calc(50% - 20px);
+ margin: 0px 5px;
+ min-height: 100px;
+ padding-bottom: 100px;
+ padding-top: 25px;
+}
+
+.dashboardItem h5 span {
+ font-size: 20px;
+ font-weight: bold;
+ vertical-align: middle;
+}
+
+.dashboardItem i {
+ vertical-align: middle;
+}
+
+.dashboardItem .compactModeSwitch {
+ cursor: auto;
+ margin-top: 20px;
+}
+
+.dashboardItem .compactModeSwitch .switch {
+ text-align: left;
+}
+
+.btns.tabs .btn {
+ transition: color 0.4s, font-size 0.4s !important;
+}
+
+.welcomeSection {
+ margin: 50px 0px;
+}
+
+.welcomeSection h5 {
+ font-weight: bold;
+ font-size: 22px;
+ margin: 0px;
+ vertical-align: middle;
+ display: inline-block;
+}
+
+.welcomeSection i {
+ vertical-align: middle;
+ margin-right: 5px;
+}
+
+.welcomeSection p {
+ color: var(--lightText);
+}
+
+.dtpsSubmissionComment {
+ margin: 32px 12px;
+}
+
+.dtpsSubmissionComment img {
+ width: 34px;
+ border-radius: 50%;
+ vertical-align: middle;
+}
+
+.dtpsSubmissionComment h5 {
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: 5px;
+ font-size: 17px;
+ color: var(--lightText);
+}
+
+.dtpsAssignmentRubricItem {
+ margin: 32px 12px;
+ padding: 20px;
+ border-radius: 15px;
+ box-shadow: var(--lightShadow);
+ background: var(--elements);
+}
+
+.dtpsAssignmentRubricItem:nth-child(1), .dtpsSubmissionComment:nth-child(1) {
+ margin-top: 12px;
+}
+
+.dtpsAssignmentRubricItem h5 {
+ font-size: 20px;
+ margin: 0px;
+ margin-bottom: 10px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.dtpsAssignmentRubricItem .score p {
+ display: inline-block;
+ margin: 0px;
+}
+
+.dtpsAssignmentRubricItem .score .scoreName {
+ font-size: 16px;
+ vertical-align: middle;
+ font-weight: bold;
+}
+
+.dtpsAssignmentRubricItem .score .points {
+ float: right;
+ vertical-align: middle;
+ display: inline-block;
+}
+
+.dtpsAssignmentRubricItem .score .points .earned {
+ font-size: 22px;
+ font-weight: bold;
+}
+
+.dtpsAssignmentRubricItem .score .points .possible {
+ opacity: 0.5;
+ font-size: 12px;
+ vertical-align: bottom;
+}
+
+.dtpsRubricScore {
+ height: 24px;
+ display: inline-block;
+}
+
+.dtpsRubricScore div {
+ display: inline-block;
+ font-size: 14px;
+ height: 24px;
+ line-height: 24px;
+ font-weight: bold;
+}
+
+.discussionHeader {
+ margin: 12px 0px;
+ margin-bottom: 20px;
+}
+
+.discussionHeader h5 {
+ display: inline-block;
+ vertical-align: middle;
+ color: var(--lightText);
+ font-size: 18px;
+ margin: 0px;
+}
+
+.discussionHeader img {
+ width: 28px;
+ vertical-align: middle;
+ border-radius: 50%;
+ margin-right: 5px;
+}
+
+.discussionHeader i {
+ color: var(--secText);
+ vertical-align: middle;
+ margin-left: 20px;
+ font-size: 16px;
+}
+
+.discussionHeader span {
+ color: var(--secText);
+ vertical-align: middle;
+ margin-left: 5px;
+ font-size: 14px;
+}
+
+.discussionFooter {
+ margin-top: 22px;
+}
+
+.discussionReply {
+ border-left: 2px solid var(--elementHover);
+ padding: 10px 0px;
+ padding-left: 30px;
+}
+
+.discussionReply h5 {
+ font-size: 18px;
+ color: var(--lightText);
+}
+
+.dash .colorBar {
+ width: 7px;
+ height: calc(100% - 32px);
+ position: absolute;
+ top: 16px;
+ left: 14px;
+ border-radius: 10px;
+ display: block !important;
+}
+
+.dash .colorBar {
+ background: var(--classColor);
+}
+
+.colorBar {
+ display: none;
+}
+
+.announcement .className {
+ color: var(--classColor);
+ font-weight: bold;
+ font-size: 16px;
+}
+
+
+.assessmentWrapper.dropped span.assessmentTitle, .assessmentWrapper.dropped .editableScore:not(.focused) {
+ opacity: 0.4;
+}
+
+.assessmentWrapper.dropped span.assessmentTitle {
+ text-decoration: line-through;
+}
+
+.assessmentWrapper span.assessmentTitle {
+ transition: opacity 0.2s;
+}
+
+.recentGrade.card {
+ padding: 20px;
+ cursor: pointer;
+}
+
+.recentGrade h5 {
+ color: var(--classColor);
+ display: flex;
+ justify-content: space-between;
+ margin: 0px;
+ font-size: 18px;
+}
+
+.recentGrade h5 span {
+ font-weight: bold;
+ display: inline-block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.recentGrade p {
+ margin: 0px;
+ margin-top: 7px;
+ color: var(--secText);
+}
+
+.numFont {
+ font-family: Cascadia Code,Consolas,Andale Mono WT,Andale Mono,Lucida Console,Lucida Sans Typewriter,DejaVu Sans Mono,Bitstream Vera Sans Mono,Liberation Mono,Nimbus Mono L,Monaco,Courier New,Courier,monospace !important;
+}
+
+.classContent .card.collapsed {
+ padding: 10px 20px;
+}
+
+.classContent .card.collapsed h4 {
+ font-size: 18px !important;
+ font-weight: normal !important;
+}
+
+.classContent .card.collapsed h4 i {
+ margin-top: -3px;
+}
+
+.classContent .card.collapsed .moduleContents {
+ display: none;
+}
+
+.classGradeCircle {
+ display: inline-block;
+ height: 60px;
+ font-size: 40px;
+ text-align: right;
+ line-height: 60px;
+ border-radius: 50%;
+ float: right;
+ vertical-align: middle;
+}
+
+.classGradeCircle .percentage {
+ color: var(--lightText);
+ font-size: 20px;
+ font-weight: bold;
+ vertical-align: middle;
+ margin-right: 20px;
+}
+
+.classGradeCircle .letter {
+ color: var(--classColor);
+ font-weight: bold;
+ vertical-align: middle;
+ width: 110px;
+ text-align: center;
+ display: inline-block;
+}
+
+.gradeStat {
+ height: 60px;
+ line-height: 60px;
+ color: var(--lightText);
+ font-size: 24px;
+ margin: 0px;
+}
+
+.smallStat {
+ height: 40px;
+ line-height: 40px;
+ color: var(--secText);
+ font-size: 20px;
+ margin: 5px 0px;
+}
+
+.gradeStat .numFont, .smallStat .numFont {
+ display: inline-block;
+ width: 110px;
+ text-align: center;
+ height: 60px;
+ line-height: 60px;
+ border-radius: 50%;
+ float: right;
+ vertical-align: middle;
+ font-size: 26px;
+ color: var(--text);
+ font-weight: bold;
+}
+
+.smallStat .numFont {
+ height: 40px;
+ line-height: 40px;
+ font-size: 18px;
+ color: var(--lightText);
+}
+
+.numFont.fraction {
+ font-size: 0px;
+}
+
+.numFont .earned {
+ font-weight: bold;
+ font-size: 14px;
+}
+
+.numFont .total {
+ color: var(--secText);
+ font-size: 12px;
+}
+
+.gradeTitle {
+ margin-bottom: 10px;
+ height: 60px;
+ line-height: 60px;
+ margin-top: 0px;
+ font-weight: bold;
+ font-size: 36px;
+}
+
+.infoChip {
+ vertical-align: middle;
+ margin: 0px 5px;
+ display: inline-block;
+ font-size: 14px;
+ height: 20px;
+ line-height: 20px;
+ color: var(--lightText);
+}
+
+.infoChip:nth-child(1) {
+ margin-left: 0px;
+}
+
+.assignmentChip {
+ padding: 5px 10px;
+ display: inline-block;
+ border-radius: 20px;
+ line-height: 24px;
+ margin: 0px 2px;
+ color: var(--lightText);
+ vertical-align: middle;
+}
+
+.assignmentChip i {
+ vertical-align: middle;
+}
+
+.assignmentChip span {
+ margin-left: 7px;
+ vertical-align: middle;
+}
+
+.progressBar {
+ padding: 5px;
+ background-color: var(--elements);
+ border-radius: 12px;
+ height: 30px;
+ margin: 10px 5px;
+ cursor: pointer;
+}
+
+.progressLabel {
+ position: absolute;
+ z-index: 5;
+ color: var(--themeText);
+}
+
+.progressBar .progress {
+ height: 32px;
+ background-color: var(--theme);
+ margin: -6px;
+ border-radius: 12px;
+ position: absolute;
+}
+
+.progressBar.big {
+ height: 50px;
+ padding: 10px;
+}
+
+.progressBar.big .progressLabel {
+ height: 32px;
+ line-height: 32px;
+ font-size: 18px;
+}
+
+.progressBar.big .progress {
+ height: 42px;
+}
+
+.infoChip i {
+ vertical-align: middle;
+ font-size: 18px;
+}
+
+.dash.cal .card {
+ margin: 25px;
+ width: 100%;
+}
+
+#id_email, #id_name {
+ display: none !important;
+}
+
+.dash.cal .announcement {
+ margin-right: 0px;
+}
+
+body.isolatedGoogleClass .header .btns {
+ display: none !important;
+}
+
+body.isolatedGoogleClass .background {
+ background: linear-gradient(to right bottom, rgb(177, 168, 35), rgb(8, 101, 59)) !important;
+}
+
+.announcement:not(.open) {
+ max-height: 200px;
+}
+
+.announcement {
+ overflow: hidden;
+}
+
+body {
+ position: relative;
+ height: 100%;
+ min-height: 100vh;
+}
+
+.sidenav .item {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.sidenav .item i {
+ margin-right: 10px;
+}
+
+.class.whatif .letter {
+ display: none;
+}
+
+.class.whatif .points {
+ display: inline !important;
+}
+
+.label i {
+ vertical-align: middle;
+}
+
+.search, .classContent i.inputIcon {
+ margin: 15px 75px 0px 10px !important;
+}
+
+.dash.stream .search, .classContent .dash.stream i.inputIcon {
+ margin: 15px 25px 0px 10px !important;
+}
+
+.classContent .assignmentPicker .btn.active {
+ background: #7b7b7b45 !important;
+ color: inherit !important;
+}
+
+.class.active .dot {
+ background-color: var(--dark);
+ color: white;
+}
+
+[data-theme-type=dark] .card .dot {
+ background-color: #181b1d;
+}
+
+body.titlebar .sidebar {
+ position: fixed;
+ top: 75;
+}
+
+.sidebar .item:not(.active) {
+ filter: none !important;
+}
+
+[data-theme-type=dark] .sidebar .item:not(.active) {
+ filter: brightness(1.2) !important;
+}
+
+.sidebar .item .label {
+ max-width: calc(100% - 32px);
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.classDivider {
+ display: inline-block;
+ width: 250px;
+ height: 2px;
+ border-radius: 10px;
+ background-color: transparent;
+ margin: 15px 0;
+}
+
+.sidebar .item .grade {
+ text-align: center;
+ width: 22px;
+ font-size: 18px;
+ font-family: var(--textFont);
+ font-weight: bold;
+}
+
+.hidegrades .sidebar .item .grade {
+ visibility: hidden !important;
+ width: 0px;
+}
+
+.class .icon {
+ font-size: 20px;
+ font-weight: bold;
+ height: 24px;
+ line-height: 24px;
+}
+
+.class.main:not(.active) {
+ color: var(--lightText) !important;
+ border-color: var(--secText) !important;
+}
+
+[data-theme-type=dark] .class.main:not(.active), [data-theme-type=dark] .class.overrideClass:not(.active) {
+ color: #ffffffbf !important;
+ border-color: #ffffff36 !important;
+}
+
+.class:not(.main):not(.active) {
+ color: var(--classColor);
+}
+
+.class:not(.main).active {
+ background-color: var(--classColor) !important;
+ color: white !important;
+}
+
+.sidebar, .abtheader {
+ background-color: var(--nav);
+}
+
+body.noSidebar .sidebar {
+ display: none;
+ visibility: hidden;
+}
+
+body.noSidebar .header {
+ width: 100%;
+ margin-left: 0px;
+}
+
+body.titlebar .background, body.titlebar .cover.image {
+ position: fixed;
+ height: 75px;
+ z-index: 10;
+}
+
+.sticky {
+ position: fixed;
+ top: 0;
+ width: 100%;
+}
+
+body.titlebar .header {
+ padding: 0px;
+ z-index: 10;
+ text-align: left;
+}
+
+body.titlebar .classContent {
+ z-index: 1;
+ padding-top: 100px;
+}
+
+body.noSidebar .classContent {
+ margin-left: 0px;
+ width: 100%;
+}
+
+body.titlebar .header h1 {
+ font-size: 40px;
+ line-height: 75px;
+ display: inline-block;
+ margin: 0px;
+ margin-left: 25px;
+ position: fixed;
+ left: 0px;
+ z-index: 200;
+}
+
+body.titlebar .header .btns {
+ margin-top: 30px;
+ position: fixed;
+ margin-left: calc(50% - 175px)
+}
+
+body.titlebar:not(.noSidebar) .header .btns {
+ margin-left: calc(50% - 525px);
+}
+
+.classContent {
+ z-index: 100;
+ top: 0;
+}
+
+.tabs.btns {
+ padding: 0px;
+ background-color: transparent !important;
+}
+
+.tabs.btns .btn {
+ border: none !important;
+ background-color: transparent !important;
+ box-shadow: none !important;
+ color: var(--text);
+ border-radius: 0px !important;
+ font-size: 15px;
+ border-bottom: 2px solid transparent !important;
+ transition: color 0.2s, border-color 0.2s !important;
+ opacity: 0.5;
+ font-weight: normal;
+}
+
+.tabs.btns .btn.active {
+ border-color: var(--text) !important;
+ font-weight: bold;
+ opacity: 1;
+}
+
+.tabs.btns .btn i {
+ font-size: 24px;
+}
+
+.sidebar, .header {
+ transition: all 0.5s;
+}
+
+.dot {
+ display: none;
+}
+
+.background, .cover.image {
+ position: absolute;
+ top: 0;
+ width: 100%;
+ height: 500px;
+ opacity: 0.2;
+}
+
+.background {
+ filter: blur(10px);
+}
+
+.header {
+ margin-left: 275px;
+ text-align: center;
+ padding-top: 132px;
+ z-index: 200;
+ position: absolute;
+ top: 0;
+ width: calc(100% - 275px);
+}
+
+.classContent .card {
+ margin: 12px 20px;
+ text-align: left;
+ border-radius: 25px;
+}
+
+.classContent .card {
+ color: var(--text);
+}
+
+.card:not(.alert) i.close {
+ position: absolute;
+ right: 0;
+ cursor: pointer;
+ top: 0;
+ margin: 25px;
+}
+
+.spinner {
+ width: 40px;
+ height: 40px;
+ margin: 40px auto;
+ background-color: var(--secText);
+ border-radius: 100%;
+ -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
+ animation: sk-scaleout 1.0s infinite ease-in-out;
+}
+
+@-webkit-keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0)
+ }
+
+ 100% {
+ -webkit-transform: scale(1.0);
+ opacity: 0;
+ }
+}
+
+@keyframes sk-scaleout {
+ 0% {
+ -webkit-transform: scale(0);
+ transform: scale(0);
+ }
+
+ 100% {
+ -webkit-transform: scale(1.0);
+ transform: scale(1.0);
+ opacity: 0;
+ }
+}
+
+.classContent .card .points {
+ display: inline-block;
+ white-space: nowrap;
+ overflow: hidden;
+ height: 24px;
+ flex-shrink: 0;
+}
+
+.classContent .points.spinner {
+ top: 25px;
+ margin-top: 0px;
+}
+
+.classContent .points .earned {
+ font-size: 24px;
+ display: inline-block;
+ font-weight: bold;
+}
+
+.classContent .points .total {
+ font-size: 14px;
+ display: inline-block;
+ color: var(--secText);
+}
+
+.classContent .assignment:not(.color) .points .total, .assignment:not(.color) .weighted {
+ color: var(--secText);
+}
+
+.assignment .weighted {
+ color: var(--secText);
+ font-size: 0.82rem;
+}
+
+.assignment .weighted i {
+ font-size: 16px !important;
+ margin-top: -3px;
+}
+
+.weight.parent .weight {
+ padding: 10px !important;
+ overflow: auto;
+ margin: 10px 75px !important;
+ transition: height 0.4s;
+}
+
+.weight.parent .weight.open {
+ height: 400px !important;
+}
+
+.weight.parent .weight:not(.open) .open, .weight.parent .weight.open .close {
+ display: none !important;
+}
+
+.weight .close p {
+ margin: 0px !important;
+ cursor: pointer;
+}
+
+.weight.parent .weight h4 {
+ cursor: pointer;
+}
+
+.weight.parent .weight p {
+ color: gray !important;
+}
+
+.weight.parent .weight:not(.open) {
+ overflow: hidden !important;
+}
+
+.badge i {
+ vertical-align: middle;
+ font-size: 20px;
+}
+
+.dash.stream .card {
+ margin-right: 25px;
+}
+
+.badge.missing {
+ color: #b7630a;
+ border-color: #b7630a;
+}
+
+.weight.parent {
+ padding: 0px !important;
+ overflow: visible;
+ margin-bottom: 100px;
+}
+
+.card .weight p {
+ color: var(--secText) !important;
+}
+
+.card.gb {
+ padding: 0 !important;
+}
+
+.dash .card .points .total {
+ color: var(--classColor);
+}
+
+.dash .card .floatingIcon {
+ color: var(--classColor) !important;
+}
+
+.card.details fieldset, .card.details #tb_handin_link, .card.details div.p, .card.details label {
+ display: none;
+}
+
+.assignment {
+ cursor: pointer;
+ padding: 15px 18px;
+ position: relative;
+ border-radius: var(--cardRadius);
+ border: 2px solid transparent;
+ transition: border 0.2s, background-color 0.2s;
+ user-select: none;
+}
+
+.assignment:hover {
+ background-color: var(--elements);
+ border-color: var(--highlight);
+}
+
+.classContent .assignment h5 {
+ margin: 0px;
+ margin-top: 6px;
+ font-size: 1rem !important;
+ min-height: 20px;
+ white-space: nowrap;
+ overflow: hidden;
+ display: flex;
+ justify-content: space-between;
+}
+
+.classContent .assignment h5 div {
+ display: inline-block;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.classContent .assignment h5 .status {
+ flex-shrink: 0;
+}
+
+.classContent .card.assignment h4 {
+ font-size: 18px;
+ margin: 0px !important;
+ white-space: nowrap;
+ height: 24px;
+ line-height: 24px;
+ display: flex;
+ justify-content: space-between;
+}
+
+.classContent .card.assignment span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.assignment .statusIcon {
+ float: right;
+ font-size: 16px;
+ vertical-align: middle;
+}
+
+.class.active .name {
+ font-weight: bold;
+}
+
+#whatIfResults {
+ display: none;
+ border: 2px solid var(--cards);
+ background-color: var(--elements);
+ position: fixed;
+ top: 0;
+ width: 400px;
+ z-index: 999 !important;
+ padding: 20px;
+ margin: 10px;
+ box-shadow: 0px 15px 20px rgba(0, 0, 0, 0.51);
+}
+
+#whatIfResults h5 {
+ font-weight: bold;
+ margin-bottom: 28px;
+}
+
+#whatIfResults .resultLetter {
+ color: gray;
+ font-weight: bold;
+ float: right;
+ display: inline-block;
+ font-size: 32px;
+}
+
+.assignmentGrade {
+ white-space: nowrap;
+ overflow: hidden;
+ font-size: 0px;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.assignmentGrade div {
+ display: inline-block;
+}
+
+.assignmentGrade .grade {
+ font-weight: bold;
+ font-size: 18px;
+ color: var(--text);
+ vertical-align: bottom;
+}
+
+.assignmentGrade .value {
+ font-size: 14px;
+ color: var(--secText);
+ vertical-align: bottom;
+ margin-left: 2px;
+}
+
+.assignmentGrade:not(:hover) .letter, .assignmentGrade:not(:hover) .percentage {
+ display: none;
+}
+
+.assignmentGrade:hover .grade, .assignmentGrade:hover .value {
+ display: none;
+}
+
+.assignmentGrade .letter {
+ font-size: 20px;
+ font-weight: bold;
+ color: var(--text);
+ vertical-align: middle;
+}
+
+.assignmentGrade .percentage {
+ font-size: 14px;
+ color: var(--secText);
+ margin-left: 4px;
+ vertical-align: middle;
+}
+
+.gradebookAssignment {
+ padding: 15px;
+ border-radius: 5px;
+ cursor: pointer;
+}
+
+.gradebookAssignment h5 {
+ margin: 0px;
+ font-size: 18px;
+ height: 20px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.gradebookAssignment .stats div {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.gradebookAssignment .stats {
+ float: right;
+ text-align: right;
+}
+
+.gradebookAssignment .gradebookLetter {
+ font-weight: bold;
+ font-size: 24px;
+ width: 50px;
+ text-align: center;
+ margin-right: 15px;
+}
+
+.gradebookAssignment .gradebookScore {
+ font-weight: bold;
+ font-size: 20px;
+ width: 80px;
+ text-align: right;
+}
+
+.gradebookAssignment .gradebookValue {
+ color: var(--secText);
+ font-size: 16px;
+ width: 70px;
+ margin-right: 10px;
+ text-align: left;
+}
+
+.gradebookAssignment .gradebookPercentage {
+ color: var(--lightText);
+ font-size: 18px;
+ width: 60px;
+ text-align: center;
+}
+
+.card.module h4 {
+ margin: 0px 2px;
+ font-size: 24px;
+ font-weight: bold;
+}
+
+.card.module h4 i {
+ cursor: pointer;
+ vertical-align: middle;
+ color: var(--lightText);
+}
+
+.moduleItem {
+ color: var(--lightText);
+ padding:5px;
+ font-size:14px;
+ border-radius:15px;
+ margin:5px 0;
+ cursor: pointer;
+}
+
+.moduleItem i {
+ vertical-align: middle;
+ margin-right: 4px;
+ font-size: 20px;
+}
+
+.background, .cover.image {
+ background-size: 100%;
+ position: absolute;
+ z-index: -90;
+}
+
+.background:before {
+ border-radius: inherit;
+ background: linear-gradient(to bottom right, var(--classColor), var(--background));
+ content: '';
+ display: block;
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0;
+ z-index: -100;
+ transition: all 0.5s ease-in-out;
+}
+
+body.dashboard .background:before {
+ background: var(--grad, linear-gradient(to bottom right, var(--cards), var(--background)));
+}
+
+.cover.image {
+ transition: all 0.2s ease-in-out;
+}
+
+.background.trans:before {
+ opacity: 1;
+ transition: all 0.5s;
+}
+
+.dash .assignment {
+ padding-left: 34px;
+}
+
+.dash .weighted {
+ color: var(--classColor) !important;
+}
+
+.dash .weighted {
+ opacity: 0.7;
+}
+
+.item.link {
+ font-size: 20px;
+ cursor: pointer;
+ margin-top: 10px;
+ padding-left: 10px;
+}
+
+.item.link i {
+ vertical-align: middle;
+ margin-right: 10px;
+}
+
+.item.link span {
+ vertical-align: middle;
+}
+
+.earned.outcomes {
+ height: 20px;
+ text-align: right;
+ writing-mode: vertical-rl;
+ line-height: 0px;
+ font-size: 0px !important;
+ white-space: normal;
+}
+
+.earned.outcomes .outcome {
+ background-color: var(--text);
+ display: inline-block;
+ vertical-align: middle;
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ margin: 1px;
+}
+
+.earned.outcomes .outcome.score1 {
+ background-color: #b90000;
+}
+
+.earned.outcomes .outcome.score2 {
+ background-color: #cc8400;
+}
+
+.earned.outcomes .outcome.score3 {
+ background-color: #b5b500;
+}
+
+.earned.outcomes .outcome.score4 {
+ background-color: #007700;
+}
+
+#whatIfGrade {
+ position: fixed;
+ top: 0px;
+ margin: 20px;
+ border-radius: 15px;
+ background-color: var(--elements);
+ border: 2px solid var(--secText);
+ padding: 20px;
+ z-index: 800;
+ box-shadow: 0px 0px 20px 10px var(--elements);
+}
+
+#whatIfGrade .letter {
+ width: 50px;
+ height: 50px;
+ background-color: var(--cards);
+ font-size: 28px;
+ font-weight: bold;
+ display: inline-block;
+ vertical-align: middle;
+ text-align: center;
+ line-height: 50px;
+ border-radius: 10px;
+ margin-right: 12px;
+}
+
+#whatIfGrade .notice {
+ display: inline-block;
+ vertical-align: middle;
+ width: 300px;
+}
+
+#whatIfGrade .notice h5 {
+ font-size: 22px;
+ margin: 0px;
+ font-weight: bold;
+}
+
+#whatIfGrade .notice p {
+ font-size: 14px;
+ margin: 0px;
+ margin-top: 10px;
+}
+
+#whatIfGrade .notice a {
+ color: var(--lightText);
+}
+
+.recentChanges .changeName {
+ font-size: 20px;
+ margin-top: 20px;
+ height: 32px;
+ line-height: 32px;
+}
+
+.recentChanges i {
+ margin-right: 10px;
+}
+
+.recentChanges .letter {
+ display: inline-block;
+ vertical-align: middle;
+ background-color: var(--elements);
+ width: 32px;
+ height: 32px;
+ text-align: center;
+ line-height: 32px;
+ margin-right: 10px;
+ border-radius: 5px;
+ font-size: 14px;
+ font-weight: bold;
+}
+
+.recentChanges .alignmentChange {
+ margin-left: 32px;
+ font-size: 14px;
+}
+
+.recentChanges .alignmentChange span {
+ font-size: 24px;
+ margin-right: 5px;
+}
+
+/* FullCalendar Fluid UI CSS cutomizations v5.3.2 */
+#calendar .fc-toolbar-title {
+ font-size: 32px !important;
+}
+
+#calendar .fc-button-primary {
+ background: none;
+ box-shadow: none;
+ border: none;
+ color: var(--text);
+}
+
+#calendar td, #calendar th, #calendar .fc-scrollgrid {
+ border: none;
+}
+
+#calendar a {
+ color: var(--text);
+}
+
+#calendar .fc-event-time {
+ display: none;
+}
+
+#calendar .fc-toolbar.fc-header-toolbar {
+ margin-bottom: 10px;
+}
+
+#calendar .fc-h-event {
+ border: 1px solid transparent;
+ cursor: pointer;
+}
+
+#calendar .fc-event-title i {
+ color: #c44848;
+ font-size: 12px;
+ vertical-align: middle;
+}
+
+#calendar .fc-daygrid-day {
+ border-radius: 5px;
+ transition: background-color 0.4s;
+ cursor: pointer;
+}
+
+#calendar .fc-daygrid-day:hover {
+ background-color: var(--elements);
+}
+
+#calendar .fc-daygrid-day.active {
+ background-color: var(--elementHover);
+}
+
+#calendar .fc-event-title span {
+ vertical-align: middle;
+}
+
+#calendar .fc-daygrid-day.fc-day-today {
+ background-color: var(--theme);
+}
+
+#calendar.dateSelected .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
+ border-radius: 50%;
+ background-color: var(--theme);
+}
+
+#calendar.dateSelected .fc-daygrid-day.fc-day-today {
+ background-color: transparent;
+}
+
+#calendar .fc-daygrid-day.fc-day-today a {
+ color: var(--themeText);
+}
+
+#calendar .fc-scroller-liquid-absolute, #calendar .fc-view-harness-active>.fc-view {
+ position: relative;
+}
+
+#calendar .fc-view-harness {
+ height: auto !important;
+}
+
+#calendar .fc-col-header, #calendar .fc-daygrid-body, #calendar .fc-daygrid-body>table {
+ width: 100% !important;
+}
+
+#calendar .fc-h-event .fc-event-title {
+ font-size: 12px;
+}
+
+.classToolChip {
+ border-radius: 50%;
+ height: 40px;
+ width: 40px;
+ text-align: center;
+ display: inline-block;
+ vertical-align: middle;
+ cursor: pointer;
+ margin-right: 3px;
+ background-color: var(--elements);
+}
+
+.classToolChip:hover {
+ background-color: var(--elementHover);
+ transition: background-color 0.2s;
+}
+
+body {
+ --cardShadow: 0 5px 15px rgb(0 0 0 / 0.08) !important;
+}
+
+.headerArea {
+ margin: 10px 20px;
+ width: auto;
+ height: 250px;
+}
+
+body.themeImage .headerArea .content {
+ background: none !important;
+}
+
+#dtpsUnstable {
+ position: absolute;
+ color: #ff4e4e;
+ cursor: auto;
+}
+
+@media(max-width: 1550px) {
+ #dtpsUnstable {
+ top: 55px;
+ right: 5px;
+ }
+}
+
+body:not(.themeImage) .headerArea:not(.classImage) h1 {
+ text-shadow: none !important;
+}
+
+body.themeImage .headerArea img {
+ display: none !important;
+}
+
+#headText {
+ transition: color 0.2s;
+ white-space: nowrap;
+ max-width: 95%;
+ text-align: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#headText span {
+ font-weight: bold;
+ vertical-align: middle;
+}
+
+#headText i {
+ margin-right: 5px;
+ vertical-align: middle;
+ font-size: 36px;
+}
+
+.gradeSummaryShowHide {
+ margin: 10px 0px;
+ cursor: pointer;
+ text-align: center;
+}
+
+.gradeSummaryShowHide i, .gradeSummaryShowHide span {
+ vertical-align: middle;
+}
+
+.gradeSummaryShowHide i {
+ margin-right: 5px;
+}
+
+#classGradeMore {
+ margin: 0px 20px;
+ padding: 20px;
+}
+
+.block.status .bottom {
+ font-size: 18px;
+}
+
+.block .previousGrade {
+ font-size: 14px;
+ opacity: 0.5;
+ position: absolute;
+ top: 50px;
+}
+
+.fixedGradeSummary #gradeSummary {
+ box-shadow: var(--lightShadow);
+ left: 275px;
+ padding: 20px;
+ position: fixed;
+ top: 60px;
+ z-index: 99;
+ width: calc(100% - 275px);
+ margin: 0px !important;
+ background: var(--navbar);
+ backdrop-filter: blur(20px);
+}
+
+body.collapsedSidebar #gradeSummary {
+ left: 72px;
+ width: calc(100% - 72px);
+}
+
+.classContent.fixedGradeSummary {
+ padding-top: 160px;
+}
+
+.block .showActualGrades {
+ font-size: 14px;
+ position: absolute;
+ top: 50px;
+ color: var(--secText);
+ cursor: pointer;
+}
+
+#classGradeMore .table tr.active {
+ background-color: var(--classColor);
+}
+
+#classGradeMore .table tr.active, #classGradeMore .table tr.active * {
+ color: white;
+ font-weight: bold;
+}
+
+#classGradeMore.whatIf .table tr.active {
+ background-color: var(--elements);
+}
+
+#classGradeMore.whatIf .table tr.active, #classGradeMore.whatIf .table tr.active * {
+ color: var(--classColor);
+}
+
+.editableScore {
+ outline: none;
+ font-size: 20px;
+ vertical-align: middle;
+ display: inline-block;
+ padding: 2px 5px;
+ border-radius: 5px;
+ margin-right: 5px;
+ transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
+ border: 2px solid transparent;
+ width: 45px;
+ text-align: center;
+}
+
+.editableScore.modified, .editableScore.focused, .editableScore:hover {
+ background-color: var(--inputColor);
+ border-color: var(--elements);
+}
+
+.teacherName {
+ color: var(--text);
+ font-size: 18px;
+}
+
+.teacherImage {
+ margin-right: 4px;
+ height: 32px;
+ width: 32px;
+ border-radius: 50%;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-color: var(--elements);
+ vertical-align: middle;
+}
+
+#dtpsFixedSearch {
+ position: fixed;
+ left: calc(50% - 250px);
+ margin: 0px;
+}
+
+#dtpsSearchResults {
+ position: fixed;
+ z-index: 100;
+ width: 500px;
+ top: 70px;
+ left: calc(50% - 250px);
+ box-shadow: 0px 0px 20px rgb(0 0 0 / 0.5);
+ border: 2px solid var(--elements);
+}
+
+#dtpsSearchResults h5 {
+ margin-top: 0px;
+}
+
+#dtpsSearchResults h5 i {
+ vertical-align: middle;
+}
+
+#dtpsSearchResults h5 span {
+ font-size: 18px;
+ font-weight: bold;
+ vertical-align: middle;
+}
+
+#settingsReloadWarning {
+ background: var(--elements);
+ border-radius: var(--elementRadius);
+ padding: 15px 18px;
+ box-shadow: var(--elementShadow);
+ margin: 24px 0px;
+}
+
+.card.searchResult {
+ padding: 15px 18px;
+ position: relative;
+ border-radius: var(--cardRadius);
+ border: 2px solid transparent;
+ cursor: pointer;
+ transition: border 0.2s, background-color 0.2s;
+ user-select: none;
+}
+
+.card.searchResult h4 {
+ font-size: 20px;
+ margin: 0px !important;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ height: 24px;
+ line-height: 24px;
+ font-weight: bold;
+}
+
+.card.searchResult h5 {
+ margin: 0px;
+}
+
+.card.searchResult .highlight {
+ font-weight: bold;
+ background-color: var(--theme);
+ color: var(--themeText);
+}
+
+.card.searchResult .highlight i {
+ color: var(--themeText) !important;
+ font-weight: bold !important;
+}
+
+.card.searchResult .statusIcon {
+ font-size: 18px;
+ color: var(--secText);
+}
+
+.searchResult.mixedClasses .colorBar {
+ width: 7px;
+ height: calc(100% - 32px);
+ position: absolute;
+ top: 16px;
+ left: 14px;
+ border-radius: 10px;
+ display: block !important;
+}
+
+.searchResult.mixedClasses .colorBar {
+ background: var(--classColor);
+}
+
+.searchResult.mixedClasses {
+ padding-left: 34px;
+}
+
+.searchResult:hover {
+ background-color: var(--elements);
+ border-color: var(--highlight);
+}
+
+#searchFilterContainer {
+ width: 400px;
+ display: inline-block;
+ vertical-align: top;
+}
+
+#searchFilterContainer .card {
+ margin-right: 10px;
+}
+
+#searchResultsContainer.withFilters {
+ margin-left: 0px;
+ width: calc(100% - 410px);
+ display: inline-block;
+}
+
+#searchResultsContainer.withFilters .card {
+ margin-left: 10px;
+}
+
+#searchFilterContainer .card h5 {
+ margin-top: 0px;
+ font-weight: bold;
+}
+
+#searchFilterContainer .card h5 span {
+ vertical-align: middle;
+ font-weight: bold;
+}
+
+#searchFilterContainer .card h5 i {
+ vertical-align: middle;
+ margin-right: 3px;
+}
+
+#searchFilterContainer .card .checkContainer {
+ margin: 10px 0px;
+}
+
+.fixedSearchFilters #searchFilterContainer .card {
+ top: 60px;
+ position: fixed;
+ width: 370px;
}
\ No newline at end of file
diff --git a/inch.json b/inch.json
index 0ffcf8b..4f0304c 100644
--- a/inch.json
+++ b/inch.json
@@ -1,8 +1,8 @@
-{
- "files": {
- "included": [
- "scripts/**/*.js",
- "init.js"
- ]
- }
-}
+{
+ "files": {
+ "included": [
+ "scripts/**/*.js",
+ "init.js"
+ ]
+ }
+}
diff --git a/init.js b/init.js
index ae863d5..3095396 100644
--- a/init.js
+++ b/init.js
@@ -1,19 +1,19 @@
-/**
- * @file DTPS bookmarklet loader
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-const DTPS_ROOT_URL = "https://powerplus.app/";
-
-if (window.location.hostname == "dtechhs.instructure.com") {
- //Load Design Tech High School script
- jQuery.getScript(DTPS_ROOT_URL + "/scripts/lms/dtech.js");
-} else if (window.location.hostname.endsWith("instructure.com")) {
- //Load Canvas LMS script
- jQuery.getScript(DTPS_ROOT_URL + "/scripts/lms/canvas.js");
-} else {
- throw "Error: Invalid domain";
+/**
+ * @file DTPS bookmarklet loader
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+const DTPS_ROOT_URL = "https://powerplus.app/";
+
+if (window.location.hostname == "dtechhs.instructure.com") {
+ //Load Design Tech High School script
+ jQuery.getScript(DTPS_ROOT_URL + "/scripts/lms/dtech.js");
+} else if (window.location.hostname.endsWith("instructure.com")) {
+ //Load Canvas LMS script
+ jQuery.getScript(DTPS_ROOT_URL + "/scripts/lms/canvas.js");
+} else {
+ throw "Error: Invalid domain";
}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 8a93895..999e2f8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,3443 +1,3443 @@
-{
- "name": "dtps",
- "requires": true,
- "lockfileVersion": 1,
- "dependencies": {
- "@babel/parser": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
- "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
- "dev": true
- },
- "abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
- },
- "accepts": {
- "version": "1.3.7",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
- "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
- "dev": true,
- "requires": {
- "mime-types": "~2.1.24",
- "negotiator": "0.6.2"
- }
- },
- "ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
- "dev": true
- },
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "requires": {
- "sprintf-js": "~1.0.2"
- },
- "dependencies": {
- "sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
- }
- }
- },
- "arr-diff": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
- "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
- "dev": true
- },
- "arr-flatten": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
- "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
- "dev": true
- },
- "arr-union": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
- "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
- "dev": true
- },
- "array-each": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
- "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
- "dev": true
- },
- "array-flatten": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
- "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
- "dev": true
- },
- "array-slice": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
- "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
- "dev": true
- },
- "array-union": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
- "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
- "dev": true,
- "requires": {
- "array-uniq": "^1.0.1"
- }
- },
- "array-uniq": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
- "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
- "dev": true
- },
- "array-unique": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
- "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
- "dev": true
- },
- "assign-symbols": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
- "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
- "dev": true
- },
- "async": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
- "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
- "dev": true
- },
- "atob": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
- "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
- "dev": true
- },
- "balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
- "dev": true
- },
- "base": {
- "version": "0.11.2",
- "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
- "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
- "dev": true,
- "requires": {
- "cache-base": "^1.0.1",
- "class-utils": "^0.3.5",
- "component-emitter": "^1.2.1",
- "define-property": "^1.0.0",
- "isobject": "^3.0.1",
- "mixin-deep": "^1.2.0",
- "pascalcase": "^0.1.1"
- },
- "dependencies": {
- "define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
- "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^1.0.0"
- }
- },
- "is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "^1.0.0",
- "is-data-descriptor": "^1.0.0",
- "kind-of": "^6.0.2"
- }
- }
- }
- },
- "bluebird": {
- "version": "3.7.2",
- "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
- "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
- "dev": true
- },
- "body-parser": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
- "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
- "dev": true,
- "requires": {
- "bytes": "3.1.0",
- "content-type": "~1.0.4",
- "debug": "2.6.9",
- "depd": "~1.1.2",
- "http-errors": "1.7.2",
- "iconv-lite": "0.4.24",
- "on-finished": "~2.3.0",
- "qs": "6.7.0",
- "raw-body": "2.4.0",
- "type-is": "~1.6.17"
- }
- },
- "boolbase": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
- "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
- "dev": true
- },
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "braces": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
- "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
- "dev": true,
- "requires": {
- "arr-flatten": "^1.1.0",
- "array-unique": "^0.3.2",
- "extend-shallow": "^2.0.1",
- "fill-range": "^4.0.0",
- "isobject": "^3.0.1",
- "repeat-element": "^1.1.2",
- "snapdragon": "^0.8.1",
- "snapdragon-node": "^2.0.1",
- "split-string": "^3.0.2",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "buffer-from": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
- "dev": true
- },
- "bytes": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
- "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
- "dev": true
- },
- "cache-base": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
- "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
- "dev": true,
- "requires": {
- "collection-visit": "^1.0.0",
- "component-emitter": "^1.2.1",
- "get-value": "^2.0.6",
- "has-value": "^1.0.0",
- "isobject": "^3.0.1",
- "set-value": "^2.0.0",
- "to-object-path": "^0.3.0",
- "union-value": "^1.0.0",
- "unset-value": "^1.0.0"
- }
- },
- "catharsis": {
- "version": "0.8.11",
- "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz",
- "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==",
- "dev": true,
- "requires": {
- "lodash": "^4.17.14"
- }
- },
- "chalk": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
- "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- }
- },
- "cheerio": {
- "version": "0.22.0",
- "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz",
- "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=",
- "dev": true,
- "requires": {
- "css-select": "~1.2.0",
- "dom-serializer": "~0.1.0",
- "entities": "~1.1.1",
- "htmlparser2": "^3.9.1",
- "lodash.assignin": "^4.0.9",
- "lodash.bind": "^4.1.4",
- "lodash.defaults": "^4.0.1",
- "lodash.filter": "^4.4.0",
- "lodash.flatten": "^4.2.0",
- "lodash.foreach": "^4.3.0",
- "lodash.map": "^4.4.0",
- "lodash.merge": "^4.4.0",
- "lodash.pick": "^4.2.1",
- "lodash.reduce": "^4.4.0",
- "lodash.reject": "^4.4.0",
- "lodash.some": "^4.4.0"
- }
- },
- "class-utils": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
- "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
- "dev": true,
- "requires": {
- "arr-union": "^3.1.0",
- "define-property": "^0.2.5",
- "isobject": "^3.0.0",
- "static-extend": "^0.1.1"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- }
- }
- },
- "clean-css": {
- "version": "4.1.11",
- "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz",
- "integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=",
- "dev": true,
- "requires": {
- "source-map": "0.5.x"
- }
- },
- "collection-visit": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
- "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
- "dev": true,
- "requires": {
- "map-visit": "^1.0.0",
- "object-visit": "^1.0.0"
- }
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "colors": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
- "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
- "dev": true
- },
- "commander": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
- "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
- "dev": true
- },
- "commondir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
- "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
- "dev": true
- },
- "component-emitter": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
- "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "content-disposition": {
- "version": "0.5.3",
- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
- "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
- "dev": true,
- "requires": {
- "safe-buffer": "5.1.2"
- }
- },
- "content-type": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
- "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
- "dev": true
- },
- "cookie": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
- "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==",
- "dev": true
- },
- "cookie-signature": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
- "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=",
- "dev": true
- },
- "copy-descriptor": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
- "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
- "dev": true
- },
- "css-select": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
- "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
- "dev": true,
- "requires": {
- "boolbase": "~1.0.0",
- "css-what": "2.1",
- "domutils": "1.5.1",
- "nth-check": "~1.0.1"
- }
- },
- "css-what": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
- "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
- "dev": true
- },
- "dateformat": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz",
- "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==",
- "dev": true
- },
- "debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- },
- "decode-uri-component": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
- "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
- "dev": true
- },
- "define-property": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
- "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
- "dev": true,
- "requires": {
- "is-descriptor": "^1.0.2",
- "isobject": "^3.0.1"
- },
- "dependencies": {
- "is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "^1.0.0",
- "is-data-descriptor": "^1.0.0",
- "kind-of": "^6.0.2"
- }
- }
- }
- },
- "depd": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
- "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
- "dev": true
- },
- "destroy": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
- "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=",
- "dev": true
- },
- "detect-file": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
- "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
- "dev": true
- },
- "dom-serializer": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
- "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
- "dev": true,
- "requires": {
- "domelementtype": "^1.3.0",
- "entities": "^1.1.1"
- }
- },
- "domelementtype": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
- "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
- "dev": true
- },
- "domhandler": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
- "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
- "dev": true,
- "requires": {
- "domelementtype": "1"
- }
- },
- "domutils": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
- "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
- "dev": true,
- "requires": {
- "dom-serializer": "0",
- "domelementtype": "1"
- }
- },
- "duplexer": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
- "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
- "dev": true
- },
- "ee-first": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
- "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=",
- "dev": true
- },
- "email-addresses": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz",
- "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==",
- "dev": true
- },
- "encodeurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
- "dev": true
- },
- "entities": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
- "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
- "dev": true
- },
- "escape-html": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
- "dev": true
- },
- "escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
- "dev": true
- },
- "esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "dev": true
- },
- "etag": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
- "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
- "dev": true
- },
- "eventemitter2": {
- "version": "0.4.14",
- "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
- "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=",
- "dev": true
- },
- "exit": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
- "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
- "dev": true
- },
- "expand-brackets": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
- "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
- "dev": true,
- "requires": {
- "debug": "^2.3.3",
- "define-property": "^0.2.5",
- "extend-shallow": "^2.0.1",
- "posix-character-classes": "^0.1.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- },
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "expand-tilde": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
- "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
- "dev": true,
- "requires": {
- "homedir-polyfill": "^1.0.1"
- }
- },
- "express": {
- "version": "4.17.1",
- "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
- "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
- "dev": true,
- "requires": {
- "accepts": "~1.3.7",
- "array-flatten": "1.1.1",
- "body-parser": "1.19.0",
- "content-disposition": "0.5.3",
- "content-type": "~1.0.4",
- "cookie": "0.4.0",
- "cookie-signature": "1.0.6",
- "debug": "2.6.9",
- "depd": "~1.1.2",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "etag": "~1.8.1",
- "finalhandler": "~1.1.2",
- "fresh": "0.5.2",
- "merge-descriptors": "1.0.1",
- "methods": "~1.1.2",
- "on-finished": "~2.3.0",
- "parseurl": "~1.3.3",
- "path-to-regexp": "0.1.7",
- "proxy-addr": "~2.0.5",
- "qs": "6.7.0",
- "range-parser": "~1.2.1",
- "safe-buffer": "5.1.2",
- "send": "0.17.1",
- "serve-static": "1.14.1",
- "setprototypeof": "1.1.1",
- "statuses": "~1.5.0",
- "type-is": "~1.6.18",
- "utils-merge": "1.0.1",
- "vary": "~1.1.2"
- }
- },
- "extend": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
- "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
- "dev": true
- },
- "extend-shallow": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
- "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
- "dev": true,
- "requires": {
- "assign-symbols": "^1.0.0",
- "is-extendable": "^1.0.1"
- },
- "dependencies": {
- "is-extendable": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
- "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
- "dev": true,
- "requires": {
- "is-plain-object": "^2.0.4"
- }
- }
- }
- },
- "extglob": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
- "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
- "dev": true,
- "requires": {
- "array-unique": "^0.3.2",
- "define-property": "^1.0.0",
- "expand-brackets": "^2.1.4",
- "extend-shallow": "^2.0.1",
- "fragment-cache": "^0.2.1",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
- "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^1.0.0"
- }
- },
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- },
- "is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "^1.0.0",
- "is-data-descriptor": "^1.0.0",
- "kind-of": "^6.0.2"
- }
- }
- }
- },
- "figures": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
- "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=",
- "dev": true,
- "requires": {
- "escape-string-regexp": "^1.0.5",
- "object-assign": "^4.1.0"
- }
- },
- "file-sync-cmp": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",
- "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=",
- "dev": true
- },
- "filename-reserved-regex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz",
- "integrity": "sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q=",
- "dev": true
- },
- "filenamify": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-1.2.1.tgz",
- "integrity": "sha1-qfL/0RxQO+0wABUCknI3jx8TZaU=",
- "dev": true,
- "requires": {
- "filename-reserved-regex": "^1.0.0",
- "strip-outer": "^1.0.0",
- "trim-repeated": "^1.0.0"
- }
- },
- "filenamify-url": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/filenamify-url/-/filenamify-url-1.0.0.tgz",
- "integrity": "sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A=",
- "dev": true,
- "requires": {
- "filenamify": "^1.0.0",
- "humanize-url": "^1.0.0"
- }
- },
- "fill-range": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
- "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
- "dev": true,
- "requires": {
- "extend-shallow": "^2.0.1",
- "is-number": "^3.0.0",
- "repeat-string": "^1.6.1",
- "to-regex-range": "^2.1.0"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "finalhandler": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
- "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
- "dev": true,
- "requires": {
- "debug": "2.6.9",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "on-finished": "~2.3.0",
- "parseurl": "~1.3.3",
- "statuses": "~1.5.0",
- "unpipe": "~1.0.0"
- }
- },
- "find-cache-dir": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
- "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
- "dev": true,
- "requires": {
- "commondir": "^1.0.1",
- "make-dir": "^3.0.2",
- "pkg-dir": "^4.1.0"
- }
- },
- "find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "requires": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- }
- },
- "findup-sync": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
- "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
- "dev": true,
- "requires": {
- "glob": "~5.0.0"
- },
- "dependencies": {
- "glob": {
- "version": "5.0.15",
- "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
- "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
- "dev": true,
- "requires": {
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "2 || 3",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- }
- }
- },
- "fined": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
- "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.2",
- "is-plain-object": "^2.0.3",
- "object.defaults": "^1.1.0",
- "object.pick": "^1.2.0",
- "parse-filepath": "^1.0.1"
- }
- },
- "flagged-respawn": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
- "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
- "dev": true
- },
- "foodoc": {
- "version": "0.0.9",
- "resolved": "https://registry.npmjs.org/foodoc/-/foodoc-0.0.9.tgz",
- "integrity": "sha1-c4IqsBvzRG7+hs3ZfobuZJZtVj8=",
- "dev": true,
- "requires": {
- "cheerio": "^0.22.0",
- "extend": "^3.0.1",
- "glob": "^7.1.2",
- "grunt": "^1.0.2",
- "grunt-contrib-clean": "^1.1.0",
- "grunt-contrib-copy": "^1.0.0",
- "grunt-contrib-cssmin": "^2.2.1",
- "grunt-contrib-uglify": "^3.3.0",
- "handlebars": "^4.0.11",
- "handlebars-layouts": "^3.1.4",
- "jsdoc": "^3.5.5",
- "lunr": "^1.0.0",
- "moment": "^2.22.1",
- "sanitize-html": "^1.18.2"
- }
- },
- "for-in": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
- "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
- "dev": true
- },
- "for-own": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
- "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
- "dev": true,
- "requires": {
- "for-in": "^1.0.1"
- }
- },
- "forwarded": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
- "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
- "dev": true
- },
- "fragment-cache": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
- "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
- "dev": true,
- "requires": {
- "map-cache": "^0.2.2"
- }
- },
- "fresh": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
- "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
- "dev": true
- },
- "fs-extra": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
- }
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
- },
- "get-value": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
- "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
- "dev": true
- },
- "getobject": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
- "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=",
- "dev": true
- },
- "gh-pages": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.1.0.tgz",
- "integrity": "sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w==",
- "dev": true,
- "requires": {
- "async": "^2.6.1",
- "commander": "^2.18.0",
- "email-addresses": "^3.0.1",
- "filenamify-url": "^1.0.0",
- "find-cache-dir": "^3.3.1",
- "fs-extra": "^8.1.0",
- "globby": "^6.1.0"
- },
- "dependencies": {
- "async": {
- "version": "2.6.3",
- "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
- "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
- "dev": true,
- "requires": {
- "lodash": "^4.17.14"
- }
- }
- }
- },
- "glob": {
- "version": "7.1.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
- "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "global-modules": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
- "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
- "dev": true,
- "requires": {
- "global-prefix": "^1.0.1",
- "is-windows": "^1.0.1",
- "resolve-dir": "^1.0.0"
- }
- },
- "global-prefix": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
- "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.2",
- "homedir-polyfill": "^1.0.1",
- "ini": "^1.3.4",
- "is-windows": "^1.0.1",
- "which": "^1.2.14"
- }
- },
- "globby": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
- "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
- "dev": true,
- "requires": {
- "array-union": "^1.0.1",
- "glob": "^7.0.3",
- "object-assign": "^4.0.1",
- "pify": "^2.0.0",
- "pinkie-promise": "^2.0.0"
- }
- },
- "graceful-fs": {
- "version": "4.2.4",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
- "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
- "dev": true
- },
- "grunt": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz",
- "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==",
- "dev": true,
- "requires": {
- "dateformat": "~3.0.3",
- "eventemitter2": "~0.4.13",
- "exit": "~0.1.2",
- "findup-sync": "~0.3.0",
- "glob": "~7.1.6",
- "grunt-cli": "~1.3.2",
- "grunt-known-options": "~1.1.0",
- "grunt-legacy-log": "~3.0.0",
- "grunt-legacy-util": "~2.0.0",
- "iconv-lite": "~0.4.13",
- "js-yaml": "~3.14.0",
- "minimatch": "~3.0.4",
- "mkdirp": "~1.0.4",
- "nopt": "~3.0.6",
- "rimraf": "~3.0.2"
- },
- "dependencies": {
- "grunt-cli": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz",
- "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==",
- "dev": true,
- "requires": {
- "grunt-known-options": "~1.1.0",
- "interpret": "~1.1.0",
- "liftoff": "~2.5.0",
- "nopt": "~4.0.1",
- "v8flags": "~3.1.1"
- },
- "dependencies": {
- "nopt": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
- "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
- "dev": true,
- "requires": {
- "abbrev": "1",
- "osenv": "^0.1.4"
- }
- }
- }
- }
- }
- },
- "grunt-contrib-clean": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz",
- "integrity": "sha1-Vkq/LQN4qYOhW54/MO51tzjEBjg=",
- "dev": true,
- "requires": {
- "async": "^1.5.2",
- "rimraf": "^2.5.1"
- },
- "dependencies": {
- "rimraf": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
- "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- }
- }
- },
- "grunt-contrib-copy": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
- "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=",
- "dev": true,
- "requires": {
- "chalk": "^1.1.1",
- "file-sync-cmp": "^0.1.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
- "requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- }
- }
- },
- "grunt-contrib-cssmin": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-2.2.1.tgz",
- "integrity": "sha512-IXNomhQ5ekVZbDbj/ik5YccoD9khU6LT2fDXqO1+/Txjq8cp0tQKjVS8i8EAbHOrSDkL7/UD6A7b+xj98gqh9w==",
- "dev": true,
- "requires": {
- "chalk": "^1.0.0",
- "clean-css": "~4.1.1",
- "maxmin": "^2.1.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
- "requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- }
- }
- },
- "grunt-contrib-uglify": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-3.4.0.tgz",
- "integrity": "sha512-UXsTpeP0pytpTYlmll3RDndsRXfdwmrf1tI/AtD/PrArQAzGmKMvj83aVt3D8egWlE6KqPjsJBLCCvfC52LI/A==",
- "dev": true,
- "requires": {
- "chalk": "^1.0.0",
- "maxmin": "^2.1.0",
- "uglify-js": "~3.4.0",
- "uri-path": "^1.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
- "requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- }
- }
- },
- "grunt-known-options": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz",
- "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==",
- "dev": true
- },
- "grunt-legacy-log": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz",
- "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==",
- "dev": true,
- "requires": {
- "colors": "~1.1.2",
- "grunt-legacy-log-utils": "~2.1.0",
- "hooker": "~0.2.3",
- "lodash": "~4.17.19"
- }
- },
- "grunt-legacy-log-utils": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz",
- "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==",
- "dev": true,
- "requires": {
- "chalk": "~4.1.0",
- "lodash": "~4.17.19"
- }
- },
- "grunt-legacy-util": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.0.tgz",
- "integrity": "sha512-ZEmYFB44bblwPE2oz3q3ygfF6hseQja9tx8I3UZIwbUik32FMWewA+d1qSFicMFB+8dNXDkh35HcDCWlpRsGlA==",
- "dev": true,
- "requires": {
- "async": "~1.5.2",
- "exit": "~0.1.1",
- "getobject": "~0.1.0",
- "hooker": "~0.2.3",
- "lodash": "~4.17.20",
- "underscore.string": "~3.3.5",
- "which": "~1.3.0"
- }
- },
- "gzip-size": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz",
- "integrity": "sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA=",
- "dev": true,
- "requires": {
- "duplexer": "^0.1.1"
- }
- },
- "handlebars": {
- "version": "4.7.6",
- "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz",
- "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==",
- "dev": true,
- "requires": {
- "minimist": "^1.2.5",
- "neo-async": "^2.6.0",
- "source-map": "^0.6.1",
- "uglify-js": "^3.1.4",
- "wordwrap": "^1.0.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "handlebars-layouts": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/handlebars-layouts/-/handlebars-layouts-3.1.4.tgz",
- "integrity": "sha1-JrO+uTG0uHffv35v6vQFjuYiiwI=",
- "dev": true
- },
- "has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.1"
- }
- },
- "has-ansi": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
- "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- },
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
- },
- "has-value": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
- "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
- "dev": true,
- "requires": {
- "get-value": "^2.0.6",
- "has-values": "^1.0.0",
- "isobject": "^3.0.0"
- }
- },
- "has-values": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
- "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
- "dev": true,
- "requires": {
- "is-number": "^3.0.0",
- "kind-of": "^4.0.0"
- },
- "dependencies": {
- "kind-of": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
- "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "homedir-polyfill": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
- "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
- "dev": true,
- "requires": {
- "parse-passwd": "^1.0.0"
- }
- },
- "hooker": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
- "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=",
- "dev": true
- },
- "htmlparser2": {
- "version": "3.10.1",
- "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
- "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
- "dev": true,
- "requires": {
- "domelementtype": "^1.3.1",
- "domhandler": "^2.3.0",
- "domutils": "^1.5.1",
- "entities": "^1.1.1",
- "inherits": "^2.0.1",
- "readable-stream": "^3.1.1"
- }
- },
- "http-errors": {
- "version": "1.7.2",
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
- "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
- "dev": true,
- "requires": {
- "depd": "~1.1.2",
- "inherits": "2.0.3",
- "setprototypeof": "1.1.1",
- "statuses": ">= 1.5.0 < 2",
- "toidentifier": "1.0.0"
- }
- },
- "humanize-url": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/humanize-url/-/humanize-url-1.0.1.tgz",
- "integrity": "sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8=",
- "dev": true,
- "requires": {
- "normalize-url": "^1.0.0",
- "strip-url-auth": "^1.0.0"
- }
- },
- "iconv-lite": {
- "version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
- "dev": true,
- "requires": {
- "safer-buffer": ">= 2.1.2 < 3"
- }
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
- "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
- "dev": true
- },
- "ini": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
- "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
- "dev": true
- },
- "interpret": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
- "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=",
- "dev": true
- },
- "ipaddr.js": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
- "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
- "dev": true
- },
- "is-absolute": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
- "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
- "dev": true,
- "requires": {
- "is-relative": "^1.0.0",
- "is-windows": "^1.0.1"
- }
- },
- "is-accessor-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
- "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
- "dev": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "is-buffer": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
- "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
- "dev": true
- },
- "is-core-module": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz",
- "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==",
- "dev": true,
- "requires": {
- "has": "^1.0.3"
- }
- },
- "is-data-descriptor": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
- "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
- "dev": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "is-descriptor": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
- "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "^0.1.6",
- "is-data-descriptor": "^0.1.4",
- "kind-of": "^5.0.0"
- },
- "dependencies": {
- "kind-of": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
- "dev": true
- }
- }
- },
- "is-extendable": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
- "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
- "dev": true
- },
- "is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true
- },
- "is-glob": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
- "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
- "dev": true,
- "requires": {
- "is-extglob": "^2.1.0"
- }
- },
- "is-number": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
- "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
- "dev": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "is-plain-obj": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
- "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
- "dev": true
- },
- "is-plain-object": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
- "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
- "dev": true,
- "requires": {
- "isobject": "^3.0.1"
- }
- },
- "is-relative": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
- "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
- "dev": true,
- "requires": {
- "is-unc-path": "^1.0.0"
- }
- },
- "is-unc-path": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
- "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
- "dev": true,
- "requires": {
- "unc-path-regex": "^0.1.2"
- }
- },
- "is-windows": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
- "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
- "dev": true
- },
- "isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
- "dev": true
- },
- "isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
- "dev": true
- },
- "js-yaml": {
- "version": "3.14.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
- "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
- "dev": true,
- "requires": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
- }
- },
- "js2xmlparser": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz",
- "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==",
- "dev": true,
- "requires": {
- "xmlcreate": "^2.0.3"
- }
- },
- "jsdoc": {
- "version": "3.6.6",
- "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz",
- "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==",
- "dev": true,
- "requires": {
- "@babel/parser": "^7.9.4",
- "bluebird": "^3.7.2",
- "catharsis": "^0.8.11",
- "escape-string-regexp": "^2.0.0",
- "js2xmlparser": "^4.0.1",
- "klaw": "^3.0.0",
- "markdown-it": "^10.0.0",
- "markdown-it-anchor": "^5.2.7",
- "marked": "^0.8.2",
- "mkdirp": "^1.0.4",
- "requizzle": "^0.2.3",
- "strip-json-comments": "^3.1.0",
- "taffydb": "2.6.2",
- "underscore": "~1.10.2"
- },
- "dependencies": {
- "escape-string-regexp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
- "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
- "dev": true
- }
- }
- },
- "jsonfile": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
- "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.6"
- }
- },
- "kind-of": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
- "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
- "dev": true
- },
- "klaw": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
- "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.9"
- }
- },
- "liftoff": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz",
- "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=",
- "dev": true,
- "requires": {
- "extend": "^3.0.0",
- "findup-sync": "^2.0.0",
- "fined": "^1.0.1",
- "flagged-respawn": "^1.0.0",
- "is-plain-object": "^2.0.4",
- "object.map": "^1.0.0",
- "rechoir": "^0.6.2",
- "resolve": "^1.1.7"
- },
- "dependencies": {
- "findup-sync": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
- "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
- "dev": true,
- "requires": {
- "detect-file": "^1.0.0",
- "is-glob": "^3.1.0",
- "micromatch": "^3.0.4",
- "resolve-dir": "^1.0.1"
- }
- }
- }
- },
- "linkify-it": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
- "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
- "dev": true,
- "requires": {
- "uc.micro": "^1.0.1"
- }
- },
- "locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "requires": {
- "p-locate": "^4.1.0"
- }
- },
- "lodash": {
- "version": "4.17.20",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
- "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
- "dev": true
- },
- "lodash.assignin": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz",
- "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=",
- "dev": true
- },
- "lodash.bind": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz",
- "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=",
- "dev": true
- },
- "lodash.defaults": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
- "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=",
- "dev": true
- },
- "lodash.filter": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz",
- "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=",
- "dev": true
- },
- "lodash.flatten": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
- "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
- "dev": true
- },
- "lodash.foreach": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz",
- "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=",
- "dev": true
- },
- "lodash.map": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
- "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
- "dev": true
- },
- "lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "lodash.pick": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz",
- "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=",
- "dev": true
- },
- "lodash.reduce": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz",
- "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=",
- "dev": true
- },
- "lodash.reject": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz",
- "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=",
- "dev": true
- },
- "lodash.some": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
- "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=",
- "dev": true
- },
- "lunr": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/lunr/-/lunr-1.0.0.tgz",
- "integrity": "sha1-XJJ2ySyRrDWpJBtQGNRnI9kuL18=",
- "dev": true
- },
- "make-dir": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
- "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
- "dev": true,
- "requires": {
- "semver": "^6.0.0"
- }
- },
- "make-iterator": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
- "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.2"
- }
- },
- "map-cache": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
- "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
- "dev": true
- },
- "map-visit": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
- "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
- "dev": true,
- "requires": {
- "object-visit": "^1.0.0"
- }
- },
- "markdown-it": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz",
- "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==",
- "dev": true,
- "requires": {
- "argparse": "^1.0.7",
- "entities": "~2.0.0",
- "linkify-it": "^2.0.0",
- "mdurl": "^1.0.1",
- "uc.micro": "^1.0.5"
- },
- "dependencies": {
- "entities": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
- "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==",
- "dev": true
- }
- }
- },
- "markdown-it-anchor": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz",
- "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==",
- "dev": true
- },
- "marked": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
- "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
- "dev": true
- },
- "maxmin": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz",
- "integrity": "sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY=",
- "dev": true,
- "requires": {
- "chalk": "^1.0.0",
- "figures": "^1.0.1",
- "gzip-size": "^3.0.0",
- "pretty-bytes": "^3.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
- "requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- }
- }
- },
- "mdurl": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
- "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
- "dev": true
- },
- "media-typer": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
- "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
- "dev": true
- },
- "merge-descriptors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
- "dev": true
- },
- "methods": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
- "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
- "dev": true
- },
- "micromatch": {
- "version": "3.1.10",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
- "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
- "dev": true,
- "requires": {
- "arr-diff": "^4.0.0",
- "array-unique": "^0.3.2",
- "braces": "^2.3.1",
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "extglob": "^2.0.4",
- "fragment-cache": "^0.2.1",
- "kind-of": "^6.0.2",
- "nanomatch": "^1.2.9",
- "object.pick": "^1.3.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.2"
- }
- },
- "mime": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
- "dev": true
- },
- "mime-db": {
- "version": "1.44.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
- "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
- "dev": true
- },
- "mime-types": {
- "version": "2.1.27",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
- "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
- "dev": true,
- "requires": {
- "mime-db": "1.44.0"
- }
- },
- "minimatch": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
- },
- "mixin-deep": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
- "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
- "dev": true,
- "requires": {
- "for-in": "^1.0.2",
- "is-extendable": "^1.0.1"
- },
- "dependencies": {
- "is-extendable": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
- "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
- "dev": true,
- "requires": {
- "is-plain-object": "^2.0.4"
- }
- }
- }
- },
- "mkdirp": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
- "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
- "dev": true
- },
- "moment": {
- "version": "2.29.1",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
- "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
- "dev": true
- },
- "ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "nanomatch": {
- "version": "1.2.13",
- "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
- "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
- "dev": true,
- "requires": {
- "arr-diff": "^4.0.0",
- "array-unique": "^0.3.2",
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "fragment-cache": "^0.2.1",
- "is-windows": "^1.0.2",
- "kind-of": "^6.0.2",
- "object.pick": "^1.3.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.1"
- }
- },
- "ncp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
- "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
- "dev": true
- },
- "negotiator": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
- "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==",
- "dev": true
- },
- "neo-async": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
- "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
- "dev": true
- },
- "nopt": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
- "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
- "dev": true,
- "requires": {
- "abbrev": "1"
- }
- },
- "normalize-url": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
- "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=",
- "dev": true,
- "requires": {
- "object-assign": "^4.0.1",
- "prepend-http": "^1.0.0",
- "query-string": "^4.1.0",
- "sort-keys": "^1.0.0"
- }
- },
- "nth-check": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
- "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
- "dev": true,
- "requires": {
- "boolbase": "~1.0.0"
- }
- },
- "number-is-nan": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
- "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
- "dev": true
- },
- "object-assign": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
- "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
- "dev": true
- },
- "object-copy": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
- "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
- "dev": true,
- "requires": {
- "copy-descriptor": "^0.1.0",
- "define-property": "^0.2.5",
- "kind-of": "^3.0.3"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- },
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "object-visit": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
- "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
- "dev": true,
- "requires": {
- "isobject": "^3.0.0"
- }
- },
- "object.defaults": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
- "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
- "dev": true,
- "requires": {
- "array-each": "^1.0.1",
- "array-slice": "^1.0.0",
- "for-own": "^1.0.0",
- "isobject": "^3.0.0"
- }
- },
- "object.map": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
- "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
- "dev": true,
- "requires": {
- "for-own": "^1.0.0",
- "make-iterator": "^1.0.0"
- }
- },
- "object.pick": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
- "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
- "dev": true,
- "requires": {
- "isobject": "^3.0.1"
- }
- },
- "on-finished": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
- "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
- "dev": true,
- "requires": {
- "ee-first": "1.1.1"
- }
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "os-homedir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
- "dev": true
- },
- "os-tmpdir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
- "dev": true
- },
- "osenv": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
- "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
- "dev": true,
- "requires": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.0"
- }
- },
- "p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "requires": {
- "p-try": "^2.0.0"
- }
- },
- "p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "requires": {
- "p-limit": "^2.2.0"
- }
- },
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
- "parse-filepath": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
- "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
- "dev": true,
- "requires": {
- "is-absolute": "^1.0.0",
- "map-cache": "^0.2.0",
- "path-root": "^0.1.1"
- }
- },
- "parse-passwd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
- "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
- "dev": true
- },
- "parse-srcset": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz",
- "integrity": "sha1-8r0iH2zJcKk42IVWq8WJyqqiveE=",
- "dev": true
- },
- "parseurl": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
- "dev": true
- },
- "pascalcase": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
- "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
- "dev": true
- },
- "path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
- "dev": true
- },
- "path-parse": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
- "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
- "dev": true
- },
- "path-root": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
- "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
- "dev": true,
- "requires": {
- "path-root-regex": "^0.1.0"
- }
- },
- "path-root-regex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
- "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=",
- "dev": true
- },
- "path-to-regexp": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=",
- "dev": true
- },
- "pify": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
- "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
- "dev": true
- },
- "pinkie": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
- "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
- "dev": true
- },
- "pinkie-promise": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
- "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
- "dev": true,
- "requires": {
- "pinkie": "^2.0.0"
- }
- },
- "pkg-dir": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
- "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
- "dev": true,
- "requires": {
- "find-up": "^4.0.0"
- }
- },
- "posix-character-classes": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
- "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
- "dev": true
- },
- "postcss": {
- "version": "7.0.35",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
- "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
- "dev": true,
- "requires": {
- "chalk": "^2.4.2",
- "source-map": "^0.6.1",
- "supports-color": "^6.1.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "^1.9.0"
- }
- },
- "chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "dependencies": {
- "supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
- },
- "color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "requires": {
- "color-name": "1.1.3"
- }
- },
- "color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
- "dev": true
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
- "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
- },
- "prepend-http": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
- "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
- "dev": true
- },
- "pretty-bytes": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz",
- "integrity": "sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8=",
- "dev": true,
- "requires": {
- "number-is-nan": "^1.0.0"
- }
- },
- "proxy-addr": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
- "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
- "dev": true,
- "requires": {
- "forwarded": "~0.1.2",
- "ipaddr.js": "1.9.1"
- }
- },
- "qs": {
- "version": "6.7.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
- "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
- "dev": true
- },
- "query-string": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
- "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
- "dev": true,
- "requires": {
- "object-assign": "^4.1.0",
- "strict-uri-encode": "^1.0.0"
- }
- },
- "range-parser": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
- "dev": true
- },
- "raw-body": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
- "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
- "dev": true,
- "requires": {
- "bytes": "3.1.0",
- "http-errors": "1.7.2",
- "iconv-lite": "0.4.24",
- "unpipe": "1.0.0"
- }
- },
- "readable-stream": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
- "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
- "dev": true,
- "requires": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- }
- },
- "rechoir": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
- "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
- "dev": true,
- "requires": {
- "resolve": "^1.1.6"
- }
- },
- "regex-not": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
- "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
- "dev": true,
- "requires": {
- "extend-shallow": "^3.0.2",
- "safe-regex": "^1.1.0"
- }
- },
- "repeat-element": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
- "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==",
- "dev": true
- },
- "repeat-string": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
- "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
- "dev": true
- },
- "requizzle": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz",
- "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==",
- "dev": true,
- "requires": {
- "lodash": "^4.17.14"
- }
- },
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dev": true,
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
- "resolve-dir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
- "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.0",
- "global-modules": "^1.0.0"
- }
- },
- "resolve-url": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
- "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
- "dev": true
- },
- "ret": {
- "version": "0.1.15",
- "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
- "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
- "dev": true
- },
- "rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- },
- "safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "dev": true
- },
- "safe-regex": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
- "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
- "dev": true,
- "requires": {
- "ret": "~0.1.10"
- }
- },
- "safer-buffer": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
- "dev": true
- },
- "sanitize-html": {
- "version": "1.27.5",
- "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.27.5.tgz",
- "integrity": "sha512-M4M5iXDAUEcZKLXkmk90zSYWEtk5NH3JmojQxKxV371fnMh+x9t1rqdmXaGoyEHw3z/X/8vnFhKjGL5xFGOJ3A==",
- "dev": true,
- "requires": {
- "htmlparser2": "^4.1.0",
- "lodash": "^4.17.15",
- "parse-srcset": "^1.0.2",
- "postcss": "^7.0.27"
- },
- "dependencies": {
- "dom-serializer": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.1.0.tgz",
- "integrity": "sha512-ox7bvGXt2n+uLWtCRLybYx60IrOlWL/aCebWJk1T0d4m3y2tzf4U3ij9wBMUb6YJZpz06HCCYuyCDveE2xXmzQ==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.0.1",
- "domhandler": "^3.0.0",
- "entities": "^2.0.0"
- }
- },
- "domelementtype": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.2.tgz",
- "integrity": "sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA==",
- "dev": true
- },
- "domhandler": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz",
- "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.0.1"
- }
- },
- "domutils": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.2.tgz",
- "integrity": "sha512-NKbgaM8ZJOecTZsIzW5gSuplsX2IWW2mIK7xVr8hTQF2v1CJWTmLZ1HOCh5sH+IzVPAGE5IucooOkvwBRAdowA==",
- "dev": true,
- "requires": {
- "dom-serializer": "^1.0.1",
- "domelementtype": "^2.0.1",
- "domhandler": "^3.3.0"
- }
- },
- "entities": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
- "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
- "dev": true
- },
- "htmlparser2": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz",
- "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.0.1",
- "domhandler": "^3.0.0",
- "domutils": "^2.0.0",
- "entities": "^2.0.0"
- }
- }
- }
- },
- "semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
- "dev": true
- },
- "send": {
- "version": "0.17.1",
- "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
- "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
- "dev": true,
- "requires": {
- "debug": "2.6.9",
- "depd": "~1.1.2",
- "destroy": "~1.0.4",
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "etag": "~1.8.1",
- "fresh": "0.5.2",
- "http-errors": "~1.7.2",
- "mime": "1.6.0",
- "ms": "2.1.1",
- "on-finished": "~2.3.0",
- "range-parser": "~1.2.1",
- "statuses": "~1.5.0"
- },
- "dependencies": {
- "ms": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
- "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
- "dev": true
- }
- }
- },
- "serve-static": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
- "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
- "dev": true,
- "requires": {
- "encodeurl": "~1.0.2",
- "escape-html": "~1.0.3",
- "parseurl": "~1.3.3",
- "send": "0.17.1"
- }
- },
- "set-value": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
- "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
- "dev": true,
- "requires": {
- "extend-shallow": "^2.0.1",
- "is-extendable": "^0.1.1",
- "is-plain-object": "^2.0.3",
- "split-string": "^3.0.1"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "setprototypeof": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
- "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
- "dev": true
- },
- "snapdragon": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
- "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
- "dev": true,
- "requires": {
- "base": "^0.11.1",
- "debug": "^2.2.0",
- "define-property": "^0.2.5",
- "extend-shallow": "^2.0.1",
- "map-cache": "^0.2.2",
- "source-map": "^0.5.6",
- "source-map-resolve": "^0.5.0",
- "use": "^3.1.0"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- },
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "snapdragon-node": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
- "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
- "dev": true,
- "requires": {
- "define-property": "^1.0.0",
- "isobject": "^3.0.0",
- "snapdragon-util": "^3.0.1"
- },
- "dependencies": {
- "define-property": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
- "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^1.0.0"
- }
- },
- "is-accessor-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
- "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-data-descriptor": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
- "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.0"
- }
- },
- "is-descriptor": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
- "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
- "dev": true,
- "requires": {
- "is-accessor-descriptor": "^1.0.0",
- "is-data-descriptor": "^1.0.0",
- "kind-of": "^6.0.2"
- }
- }
- }
- },
- "snapdragon-util": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
- "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
- "dev": true,
- "requires": {
- "kind-of": "^3.2.0"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "sort-keys": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
- "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
- "dev": true,
- "requires": {
- "is-plain-obj": "^1.0.0"
- }
- },
- "source-map": {
- "version": "0.5.7",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
- "dev": true
- },
- "source-map-resolve": {
- "version": "0.5.3",
- "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
- "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
- "dev": true,
- "requires": {
- "atob": "^2.1.2",
- "decode-uri-component": "^0.2.0",
- "resolve-url": "^0.2.1",
- "source-map-url": "^0.4.0",
- "urix": "^0.1.0"
- }
- },
- "source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
- "dev": true,
- "requires": {
- "buffer-from": "^1.0.0",
- "source-map": "^0.6.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "source-map-url": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
- "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
- "dev": true
- },
- "split-string": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
- "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
- "dev": true,
- "requires": {
- "extend-shallow": "^3.0.0"
- }
- },
- "sprintf-js": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
- "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
- "dev": true
- },
- "static-extend": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
- "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
- "dev": true,
- "requires": {
- "define-property": "^0.2.5",
- "object-copy": "^0.1.0"
- },
- "dependencies": {
- "define-property": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
- "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
- "dev": true,
- "requires": {
- "is-descriptor": "^0.1.0"
- }
- }
- }
- },
- "statuses": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
- "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
- "dev": true
- },
- "strict-uri-encode": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
- "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
- "dev": true
- },
- "string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dev": true,
- "requires": {
- "safe-buffer": "~5.2.0"
- },
- "dependencies": {
- "safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "dev": true
- }
- }
- },
- "strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- },
- "strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true
- },
- "strip-outer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
- "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
- "dev": true,
- "requires": {
- "escape-string-regexp": "^1.0.2"
- }
- },
- "strip-url-auth": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz",
- "integrity": "sha1-IrD6OkE4WzO+PzMVUbu4N/oM164=",
- "dev": true
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- },
- "taffydb": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz",
- "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=",
- "dev": true
- },
- "terser": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.0.tgz",
- "integrity": "sha512-eopt1Gf7/AQyPhpygdKePTzaet31TvQxXvrf7xYUvD/d8qkCJm4SKPDzu+GHK5ZaYTn8rvttfqaZc3swK21e5g==",
- "dev": true,
- "requires": {
- "commander": "^2.20.0",
- "source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
- },
- "dependencies": {
- "commander": {
- "version": "2.20.3",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
- "dev": true
- },
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "dev": true
- }
- }
- },
- "to-object-path": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
- "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
- "dev": true,
- "requires": {
- "kind-of": "^3.0.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- }
- }
- },
- "to-regex": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
- "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
- "dev": true,
- "requires": {
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "regex-not": "^1.0.2",
- "safe-regex": "^1.1.0"
- }
- },
- "to-regex-range": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
- "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
- "dev": true,
- "requires": {
- "is-number": "^3.0.0",
- "repeat-string": "^1.6.1"
- }
- },
- "toidentifier": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
- "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
- "dev": true
- },
- "trim-repeated": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
- "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
- "dev": true,
- "requires": {
- "escape-string-regexp": "^1.0.2"
- }
- },
- "type-is": {
- "version": "1.6.18",
- "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
- "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
- "dev": true,
- "requires": {
- "media-typer": "0.3.0",
- "mime-types": "~2.1.24"
- }
- },
- "uc.micro": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
- "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
- "dev": true
- },
- "uglify-js": {
- "version": "3.4.10",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
- "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==",
- "dev": true,
- "requires": {
- "commander": "~2.19.0",
- "source-map": "~0.6.1"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "unc-path-regex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
- "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=",
- "dev": true
- },
- "underscore": {
- "version": "1.10.2",
- "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz",
- "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==",
- "dev": true
- },
- "underscore.string": {
- "version": "3.3.5",
- "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz",
- "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==",
- "dev": true,
- "requires": {
- "sprintf-js": "^1.0.3",
- "util-deprecate": "^1.0.2"
- }
- },
- "union-value": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
- "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
- "dev": true,
- "requires": {
- "arr-union": "^3.1.0",
- "get-value": "^2.0.6",
- "is-extendable": "^0.1.1",
- "set-value": "^2.0.1"
- }
- },
- "universalify": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
- "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
- "dev": true
- },
- "unpipe": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
- "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
- "dev": true
- },
- "unset-value": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
- "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
- "dev": true,
- "requires": {
- "has-value": "^0.3.1",
- "isobject": "^3.0.0"
- },
- "dependencies": {
- "has-value": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
- "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
- "dev": true,
- "requires": {
- "get-value": "^2.0.3",
- "has-values": "^0.1.4",
- "isobject": "^2.0.0"
- },
- "dependencies": {
- "isobject": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
- "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
- "dev": true,
- "requires": {
- "isarray": "1.0.0"
- }
- }
- }
- },
- "has-values": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
- "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
- "dev": true
- }
- }
- },
- "uri-path": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz",
- "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=",
- "dev": true
- },
- "urix": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
- "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
- "dev": true
- },
- "use": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
- "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
- "dev": true
- },
- "util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
- "dev": true
- },
- "utils-merge": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
- "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
- "dev": true
- },
- "v8flags": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz",
- "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==",
- "dev": true,
- "requires": {
- "homedir-polyfill": "^1.0.1"
- }
- },
- "vary": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
- "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
- "dev": true
- },
- "which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
- "wordwrap": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
- "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
- "dev": true
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "xmlcreate": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz",
- "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==",
- "dev": true
- }
- }
-}
+{
+ "name": "dtps",
+ "requires": true,
+ "lockfileVersion": 1,
+ "dependencies": {
+ "@babel/parser": {
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
+ "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
+ "dev": true
+ },
+ "abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "accepts": {
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
+ "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
+ "dev": true,
+ "requires": {
+ "mime-types": "~2.1.24",
+ "negotiator": "0.6.2"
+ }
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "requires": {
+ "sprintf-js": "~1.0.2"
+ },
+ "dependencies": {
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+ "dev": true
+ }
+ }
+ },
+ "arr-diff": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
+ "dev": true
+ },
+ "arr-flatten": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+ "dev": true
+ },
+ "arr-union": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
+ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
+ "dev": true
+ },
+ "array-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
+ "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
+ "dev": true
+ },
+ "array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
+ "dev": true
+ },
+ "array-slice": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
+ "dev": true
+ },
+ "array-union": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
+ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
+ "dev": true,
+ "requires": {
+ "array-uniq": "^1.0.1"
+ }
+ },
+ "array-uniq": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
+ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
+ "dev": true
+ },
+ "array-unique": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
+ "dev": true
+ },
+ "assign-symbols": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
+ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
+ "dev": true
+ },
+ "async": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
+ "dev": true
+ },
+ "atob": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
+ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "dev": true
+ },
+ "base": {
+ "version": "0.11.2",
+ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
+ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
+ "dev": true,
+ "requires": {
+ "cache-base": "^1.0.1",
+ "class-utils": "^0.3.5",
+ "component-emitter": "^1.2.1",
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.1",
+ "mixin-deep": "^1.2.0",
+ "pascalcase": "^0.1.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
+ }
+ },
+ "bluebird": {
+ "version": "3.7.2",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
+ "dev": true
+ },
+ "body-parser": {
+ "version": "1.19.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
+ "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
+ "dev": true,
+ "requires": {
+ "bytes": "3.1.0",
+ "content-type": "~1.0.4",
+ "debug": "2.6.9",
+ "depd": "~1.1.2",
+ "http-errors": "1.7.2",
+ "iconv-lite": "0.4.24",
+ "on-finished": "~2.3.0",
+ "qs": "6.7.0",
+ "raw-body": "2.4.0",
+ "type-is": "~1.6.17"
+ }
+ },
+ "boolbase": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "buffer-from": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+ "dev": true
+ },
+ "bytes": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
+ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
+ "dev": true
+ },
+ "cache-base": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
+ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
+ "dev": true,
+ "requires": {
+ "collection-visit": "^1.0.0",
+ "component-emitter": "^1.2.1",
+ "get-value": "^2.0.6",
+ "has-value": "^1.0.0",
+ "isobject": "^3.0.1",
+ "set-value": "^2.0.0",
+ "to-object-path": "^0.3.0",
+ "union-value": "^1.0.0",
+ "unset-value": "^1.0.0"
+ }
+ },
+ "catharsis": {
+ "version": "0.8.11",
+ "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz",
+ "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.14"
+ }
+ },
+ "chalk": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
+ "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "cheerio": {
+ "version": "0.22.0",
+ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz",
+ "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=",
+ "dev": true,
+ "requires": {
+ "css-select": "~1.2.0",
+ "dom-serializer": "~0.1.0",
+ "entities": "~1.1.1",
+ "htmlparser2": "^3.9.1",
+ "lodash.assignin": "^4.0.9",
+ "lodash.bind": "^4.1.4",
+ "lodash.defaults": "^4.0.1",
+ "lodash.filter": "^4.4.0",
+ "lodash.flatten": "^4.2.0",
+ "lodash.foreach": "^4.3.0",
+ "lodash.map": "^4.4.0",
+ "lodash.merge": "^4.4.0",
+ "lodash.pick": "^4.2.1",
+ "lodash.reduce": "^4.4.0",
+ "lodash.reject": "^4.4.0",
+ "lodash.some": "^4.4.0"
+ }
+ },
+ "class-utils": {
+ "version": "0.3.6",
+ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
+ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
+ "dev": true,
+ "requires": {
+ "arr-union": "^3.1.0",
+ "define-property": "^0.2.5",
+ "isobject": "^3.0.0",
+ "static-extend": "^0.1.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ }
+ }
+ },
+ "clean-css": {
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz",
+ "integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=",
+ "dev": true,
+ "requires": {
+ "source-map": "0.5.x"
+ }
+ },
+ "collection-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
+ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
+ "dev": true,
+ "requires": {
+ "map-visit": "^1.0.0",
+ "object-visit": "^1.0.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "colors": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
+ "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
+ "dev": true
+ },
+ "commander": {
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
+ "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
+ "dev": true
+ },
+ "commondir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
+ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
+ "dev": true
+ },
+ "component-emitter": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
+ "dev": true
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "content-disposition": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
+ "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "5.1.2"
+ }
+ },
+ "content-type": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
+ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
+ "dev": true
+ },
+ "cookie": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
+ "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==",
+ "dev": true
+ },
+ "cookie-signature": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
+ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=",
+ "dev": true
+ },
+ "copy-descriptor": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
+ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
+ "dev": true
+ },
+ "css-select": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
+ "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
+ "dev": true,
+ "requires": {
+ "boolbase": "~1.0.0",
+ "css-what": "2.1",
+ "domutils": "1.5.1",
+ "nth-check": "~1.0.1"
+ }
+ },
+ "css-what": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
+ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
+ "dev": true
+ },
+ "dateformat": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz",
+ "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==",
+ "dev": true
+ },
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "decode-uri-component": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
+ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
+ "dev": true
+ },
+ "define-property": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
+ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.2",
+ "isobject": "^3.0.1"
+ },
+ "dependencies": {
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
+ }
+ },
+ "depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
+ "dev": true
+ },
+ "destroy": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
+ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=",
+ "dev": true
+ },
+ "detect-file": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
+ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
+ "dev": true
+ },
+ "dom-serializer": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
+ "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^1.3.0",
+ "entities": "^1.1.1"
+ }
+ },
+ "domelementtype": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+ "dev": true
+ },
+ "domhandler": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
+ "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "1"
+ }
+ },
+ "domutils": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
+ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
+ "dev": true,
+ "requires": {
+ "dom-serializer": "0",
+ "domelementtype": "1"
+ }
+ },
+ "duplexer": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
+ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
+ "dev": true
+ },
+ "ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=",
+ "dev": true
+ },
+ "email-addresses": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz",
+ "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==",
+ "dev": true
+ },
+ "encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
+ "dev": true
+ },
+ "entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "dev": true
+ },
+ "escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true
+ },
+ "etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
+ "dev": true
+ },
+ "eventemitter2": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
+ "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=",
+ "dev": true
+ },
+ "exit": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
+ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
+ "dev": true
+ },
+ "expand-brackets": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
+ "dev": true,
+ "requires": {
+ "debug": "^2.3.3",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "posix-character-classes": "^0.1.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "expand-tilde": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
+ "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
+ "dev": true,
+ "requires": {
+ "homedir-polyfill": "^1.0.1"
+ }
+ },
+ "express": {
+ "version": "4.17.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
+ "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
+ "dev": true,
+ "requires": {
+ "accepts": "~1.3.7",
+ "array-flatten": "1.1.1",
+ "body-parser": "1.19.0",
+ "content-disposition": "0.5.3",
+ "content-type": "~1.0.4",
+ "cookie": "0.4.0",
+ "cookie-signature": "1.0.6",
+ "debug": "2.6.9",
+ "depd": "~1.1.2",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "~1.1.2",
+ "fresh": "0.5.2",
+ "merge-descriptors": "1.0.1",
+ "methods": "~1.1.2",
+ "on-finished": "~2.3.0",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "0.1.7",
+ "proxy-addr": "~2.0.5",
+ "qs": "6.7.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.1.2",
+ "send": "0.17.1",
+ "serve-static": "1.14.1",
+ "setprototypeof": "1.1.1",
+ "statuses": "~1.5.0",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ }
+ },
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "dev": true
+ },
+ "extend-shallow": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
+ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
+ "dev": true,
+ "requires": {
+ "assign-symbols": "^1.0.0",
+ "is-extendable": "^1.0.1"
+ },
+ "dependencies": {
+ "is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dev": true,
+ "requires": {
+ "is-plain-object": "^2.0.4"
+ }
+ }
+ }
+ },
+ "extglob": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
+ "dev": true,
+ "requires": {
+ "array-unique": "^0.3.2",
+ "define-property": "^1.0.0",
+ "expand-brackets": "^2.1.4",
+ "extend-shallow": "^2.0.1",
+ "fragment-cache": "^0.2.1",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
+ }
+ },
+ "figures": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
+ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.5",
+ "object-assign": "^4.1.0"
+ }
+ },
+ "file-sync-cmp": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",
+ "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=",
+ "dev": true
+ },
+ "filename-reserved-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz",
+ "integrity": "sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q=",
+ "dev": true
+ },
+ "filenamify": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-1.2.1.tgz",
+ "integrity": "sha1-qfL/0RxQO+0wABUCknI3jx8TZaU=",
+ "dev": true,
+ "requires": {
+ "filename-reserved-regex": "^1.0.0",
+ "strip-outer": "^1.0.0",
+ "trim-repeated": "^1.0.0"
+ }
+ },
+ "filenamify-url": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/filenamify-url/-/filenamify-url-1.0.0.tgz",
+ "integrity": "sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A=",
+ "dev": true,
+ "requires": {
+ "filenamify": "^1.0.0",
+ "humanize-url": "^1.0.0"
+ }
+ },
+ "fill-range": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "finalhandler": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
+ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.3.0",
+ "parseurl": "~1.3.3",
+ "statuses": "~1.5.0",
+ "unpipe": "~1.0.0"
+ }
+ },
+ "find-cache-dir": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
+ "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
+ "dev": true,
+ "requires": {
+ "commondir": "^1.0.1",
+ "make-dir": "^3.0.2",
+ "pkg-dir": "^4.1.0"
+ }
+ },
+ "find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "findup-sync": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
+ "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
+ "dev": true,
+ "requires": {
+ "glob": "~5.0.0"
+ },
+ "dependencies": {
+ "glob": {
+ "version": "5.0.15",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
+ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
+ "dev": true,
+ "requires": {
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "2 || 3",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
+ }
+ },
+ "fined": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
+ "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
+ "dev": true,
+ "requires": {
+ "expand-tilde": "^2.0.2",
+ "is-plain-object": "^2.0.3",
+ "object.defaults": "^1.1.0",
+ "object.pick": "^1.2.0",
+ "parse-filepath": "^1.0.1"
+ }
+ },
+ "flagged-respawn": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
+ "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
+ "dev": true
+ },
+ "foodoc": {
+ "version": "0.0.9",
+ "resolved": "https://registry.npmjs.org/foodoc/-/foodoc-0.0.9.tgz",
+ "integrity": "sha1-c4IqsBvzRG7+hs3ZfobuZJZtVj8=",
+ "dev": true,
+ "requires": {
+ "cheerio": "^0.22.0",
+ "extend": "^3.0.1",
+ "glob": "^7.1.2",
+ "grunt": "^1.0.2",
+ "grunt-contrib-clean": "^1.1.0",
+ "grunt-contrib-copy": "^1.0.0",
+ "grunt-contrib-cssmin": "^2.2.1",
+ "grunt-contrib-uglify": "^3.3.0",
+ "handlebars": "^4.0.11",
+ "handlebars-layouts": "^3.1.4",
+ "jsdoc": "^3.5.5",
+ "lunr": "^1.0.0",
+ "moment": "^2.22.1",
+ "sanitize-html": "^1.18.2"
+ }
+ },
+ "for-in": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
+ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
+ "dev": true
+ },
+ "for-own": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
+ "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
+ "dev": true,
+ "requires": {
+ "for-in": "^1.0.1"
+ }
+ },
+ "forwarded": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
+ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
+ "dev": true
+ },
+ "fragment-cache": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
+ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
+ "dev": true,
+ "requires": {
+ "map-cache": "^0.2.2"
+ }
+ },
+ "fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
+ "dev": true
+ },
+ "fs-extra": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
+ "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.0"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
+ },
+ "get-value": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
+ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
+ "dev": true
+ },
+ "getobject": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
+ "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=",
+ "dev": true
+ },
+ "gh-pages": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.1.0.tgz",
+ "integrity": "sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w==",
+ "dev": true,
+ "requires": {
+ "async": "^2.6.1",
+ "commander": "^2.18.0",
+ "email-addresses": "^3.0.1",
+ "filenamify-url": "^1.0.0",
+ "find-cache-dir": "^3.3.1",
+ "fs-extra": "^8.1.0",
+ "globby": "^6.1.0"
+ },
+ "dependencies": {
+ "async": {
+ "version": "2.6.3",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
+ "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.14"
+ }
+ }
+ }
+ },
+ "glob": {
+ "version": "7.1.6",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
+ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "global-modules": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
+ "dev": true,
+ "requires": {
+ "global-prefix": "^1.0.1",
+ "is-windows": "^1.0.1",
+ "resolve-dir": "^1.0.0"
+ }
+ },
+ "global-prefix": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
+ "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
+ "dev": true,
+ "requires": {
+ "expand-tilde": "^2.0.2",
+ "homedir-polyfill": "^1.0.1",
+ "ini": "^1.3.4",
+ "is-windows": "^1.0.1",
+ "which": "^1.2.14"
+ }
+ },
+ "globby": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
+ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
+ "dev": true,
+ "requires": {
+ "array-union": "^1.0.1",
+ "glob": "^7.0.3",
+ "object-assign": "^4.0.1",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.4",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
+ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
+ "dev": true
+ },
+ "grunt": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz",
+ "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==",
+ "dev": true,
+ "requires": {
+ "dateformat": "~3.0.3",
+ "eventemitter2": "~0.4.13",
+ "exit": "~0.1.2",
+ "findup-sync": "~0.3.0",
+ "glob": "~7.1.6",
+ "grunt-cli": "~1.3.2",
+ "grunt-known-options": "~1.1.0",
+ "grunt-legacy-log": "~3.0.0",
+ "grunt-legacy-util": "~2.0.0",
+ "iconv-lite": "~0.4.13",
+ "js-yaml": "~3.14.0",
+ "minimatch": "~3.0.4",
+ "mkdirp": "~1.0.4",
+ "nopt": "~3.0.6",
+ "rimraf": "~3.0.2"
+ },
+ "dependencies": {
+ "grunt-cli": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz",
+ "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==",
+ "dev": true,
+ "requires": {
+ "grunt-known-options": "~1.1.0",
+ "interpret": "~1.1.0",
+ "liftoff": "~2.5.0",
+ "nopt": "~4.0.1",
+ "v8flags": "~3.1.1"
+ },
+ "dependencies": {
+ "nopt": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
+ "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
+ "dev": true,
+ "requires": {
+ "abbrev": "1",
+ "osenv": "^0.1.4"
+ }
+ }
+ }
+ }
+ }
+ },
+ "grunt-contrib-clean": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz",
+ "integrity": "sha1-Vkq/LQN4qYOhW54/MO51tzjEBjg=",
+ "dev": true,
+ "requires": {
+ "async": "^1.5.2",
+ "rimraf": "^2.5.1"
+ },
+ "dependencies": {
+ "rimraf": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ }
+ }
+ },
+ "grunt-contrib-copy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
+ "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.1",
+ "file-sync-cmp": "^0.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "grunt-contrib-cssmin": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-2.2.1.tgz",
+ "integrity": "sha512-IXNomhQ5ekVZbDbj/ik5YccoD9khU6LT2fDXqO1+/Txjq8cp0tQKjVS8i8EAbHOrSDkL7/UD6A7b+xj98gqh9w==",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.0.0",
+ "clean-css": "~4.1.1",
+ "maxmin": "^2.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "grunt-contrib-uglify": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-3.4.0.tgz",
+ "integrity": "sha512-UXsTpeP0pytpTYlmll3RDndsRXfdwmrf1tI/AtD/PrArQAzGmKMvj83aVt3D8egWlE6KqPjsJBLCCvfC52LI/A==",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.0.0",
+ "maxmin": "^2.1.0",
+ "uglify-js": "~3.4.0",
+ "uri-path": "^1.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "grunt-known-options": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz",
+ "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==",
+ "dev": true
+ },
+ "grunt-legacy-log": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz",
+ "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==",
+ "dev": true,
+ "requires": {
+ "colors": "~1.1.2",
+ "grunt-legacy-log-utils": "~2.1.0",
+ "hooker": "~0.2.3",
+ "lodash": "~4.17.19"
+ }
+ },
+ "grunt-legacy-log-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz",
+ "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==",
+ "dev": true,
+ "requires": {
+ "chalk": "~4.1.0",
+ "lodash": "~4.17.19"
+ }
+ },
+ "grunt-legacy-util": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.0.tgz",
+ "integrity": "sha512-ZEmYFB44bblwPE2oz3q3ygfF6hseQja9tx8I3UZIwbUik32FMWewA+d1qSFicMFB+8dNXDkh35HcDCWlpRsGlA==",
+ "dev": true,
+ "requires": {
+ "async": "~1.5.2",
+ "exit": "~0.1.1",
+ "getobject": "~0.1.0",
+ "hooker": "~0.2.3",
+ "lodash": "~4.17.20",
+ "underscore.string": "~3.3.5",
+ "which": "~1.3.0"
+ }
+ },
+ "gzip-size": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz",
+ "integrity": "sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA=",
+ "dev": true,
+ "requires": {
+ "duplexer": "^0.1.1"
+ }
+ },
+ "handlebars": {
+ "version": "4.7.6",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz",
+ "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==",
+ "dev": true,
+ "requires": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.0",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
+ "wordwrap": "^1.0.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
+ "handlebars-layouts": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/handlebars-layouts/-/handlebars-layouts-3.1.4.tgz",
+ "integrity": "sha1-JrO+uTG0uHffv35v6vQFjuYiiwI=",
+ "dev": true
+ },
+ "has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
+ "requires": {
+ "function-bind": "^1.1.1"
+ }
+ },
+ "has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "has-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
+ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
+ "dev": true,
+ "requires": {
+ "get-value": "^2.0.6",
+ "has-values": "^1.0.0",
+ "isobject": "^3.0.0"
+ }
+ },
+ "has-values": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
+ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
+ "dev": true,
+ "requires": {
+ "is-number": "^3.0.0",
+ "kind-of": "^4.0.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
+ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "homedir-polyfill": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
+ "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
+ "dev": true,
+ "requires": {
+ "parse-passwd": "^1.0.0"
+ }
+ },
+ "hooker": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
+ "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=",
+ "dev": true
+ },
+ "htmlparser2": {
+ "version": "3.10.1",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
+ "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^1.3.1",
+ "domhandler": "^2.3.0",
+ "domutils": "^1.5.1",
+ "entities": "^1.1.1",
+ "inherits": "^2.0.1",
+ "readable-stream": "^3.1.1"
+ }
+ },
+ "http-errors": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
+ "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
+ "dev": true,
+ "requires": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.3",
+ "setprototypeof": "1.1.1",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.0"
+ }
+ },
+ "humanize-url": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/humanize-url/-/humanize-url-1.0.1.tgz",
+ "integrity": "sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8=",
+ "dev": true,
+ "requires": {
+ "normalize-url": "^1.0.0",
+ "strip-url-auth": "^1.0.0"
+ }
+ },
+ "iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
+ "dev": true
+ },
+ "ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+ "dev": true
+ },
+ "interpret": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
+ "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=",
+ "dev": true
+ },
+ "ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "dev": true
+ },
+ "is-absolute": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
+ "dev": true,
+ "requires": {
+ "is-relative": "^1.0.0",
+ "is-windows": "^1.0.1"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-buffer": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
+ "dev": true
+ },
+ "is-core-module": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz",
+ "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==",
+ "dev": true,
+ "requires": {
+ "has": "^1.0.3"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "dev": true
+ }
+ }
+ },
+ "is-extendable": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
+ "dev": true
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.0"
+ }
+ },
+ "is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-plain-obj": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+ "dev": true
+ },
+ "is-plain-object": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.1"
+ }
+ },
+ "is-relative": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
+ "dev": true,
+ "requires": {
+ "is-unc-path": "^1.0.0"
+ }
+ },
+ "is-unc-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
+ "dev": true,
+ "requires": {
+ "unc-path-regex": "^0.1.2"
+ }
+ },
+ "is-windows": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
+ "dev": true
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "dev": true
+ },
+ "isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
+ "dev": true
+ },
+ "js-yaml": {
+ "version": "3.14.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
+ "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
+ },
+ "js2xmlparser": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz",
+ "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==",
+ "dev": true,
+ "requires": {
+ "xmlcreate": "^2.0.3"
+ }
+ },
+ "jsdoc": {
+ "version": "3.6.6",
+ "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz",
+ "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==",
+ "dev": true,
+ "requires": {
+ "@babel/parser": "^7.9.4",
+ "bluebird": "^3.7.2",
+ "catharsis": "^0.8.11",
+ "escape-string-regexp": "^2.0.0",
+ "js2xmlparser": "^4.0.1",
+ "klaw": "^3.0.0",
+ "markdown-it": "^10.0.0",
+ "markdown-it-anchor": "^5.2.7",
+ "marked": "^0.8.2",
+ "mkdirp": "^1.0.4",
+ "requizzle": "^0.2.3",
+ "strip-json-comments": "^3.1.0",
+ "taffydb": "2.6.2",
+ "underscore": "~1.10.2"
+ },
+ "dependencies": {
+ "escape-string-regexp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+ "dev": true
+ }
+ }
+ },
+ "jsonfile": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
+ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+ "dev": true
+ },
+ "klaw": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
+ "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.9"
+ }
+ },
+ "liftoff": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz",
+ "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=",
+ "dev": true,
+ "requires": {
+ "extend": "^3.0.0",
+ "findup-sync": "^2.0.0",
+ "fined": "^1.0.1",
+ "flagged-respawn": "^1.0.0",
+ "is-plain-object": "^2.0.4",
+ "object.map": "^1.0.0",
+ "rechoir": "^0.6.2",
+ "resolve": "^1.1.7"
+ },
+ "dependencies": {
+ "findup-sync": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
+ "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
+ "dev": true,
+ "requires": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^3.1.0",
+ "micromatch": "^3.0.4",
+ "resolve-dir": "^1.0.1"
+ }
+ }
+ }
+ },
+ "linkify-it": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
+ "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
+ "dev": true,
+ "requires": {
+ "uc.micro": "^1.0.1"
+ }
+ },
+ "locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^4.1.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.20",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
+ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
+ "dev": true
+ },
+ "lodash.assignin": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz",
+ "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=",
+ "dev": true
+ },
+ "lodash.bind": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz",
+ "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=",
+ "dev": true
+ },
+ "lodash.defaults": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
+ "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=",
+ "dev": true
+ },
+ "lodash.filter": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz",
+ "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=",
+ "dev": true
+ },
+ "lodash.flatten": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
+ "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
+ "dev": true
+ },
+ "lodash.foreach": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz",
+ "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=",
+ "dev": true
+ },
+ "lodash.map": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
+ "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
+ "dev": true
+ },
+ "lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "dev": true
+ },
+ "lodash.pick": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz",
+ "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=",
+ "dev": true
+ },
+ "lodash.reduce": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz",
+ "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=",
+ "dev": true
+ },
+ "lodash.reject": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz",
+ "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=",
+ "dev": true
+ },
+ "lodash.some": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
+ "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=",
+ "dev": true
+ },
+ "lunr": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lunr/-/lunr-1.0.0.tgz",
+ "integrity": "sha1-XJJ2ySyRrDWpJBtQGNRnI9kuL18=",
+ "dev": true
+ },
+ "make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dev": true,
+ "requires": {
+ "semver": "^6.0.0"
+ }
+ },
+ "make-iterator": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.2"
+ }
+ },
+ "map-cache": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
+ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
+ "dev": true
+ },
+ "map-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
+ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
+ "dev": true,
+ "requires": {
+ "object-visit": "^1.0.0"
+ }
+ },
+ "markdown-it": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz",
+ "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "entities": "~2.0.0",
+ "linkify-it": "^2.0.0",
+ "mdurl": "^1.0.1",
+ "uc.micro": "^1.0.5"
+ },
+ "dependencies": {
+ "entities": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
+ "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==",
+ "dev": true
+ }
+ }
+ },
+ "markdown-it-anchor": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz",
+ "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==",
+ "dev": true
+ },
+ "marked": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
+ "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
+ "dev": true
+ },
+ "maxmin": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz",
+ "integrity": "sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.0.0",
+ "figures": "^1.0.1",
+ "gzip-size": "^3.0.0",
+ "pretty-bytes": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "mdurl": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
+ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
+ "dev": true
+ },
+ "media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
+ "dev": true
+ },
+ "merge-descriptors": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
+ "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
+ "dev": true
+ },
+ "methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
+ "dev": true
+ },
+ "micromatch": {
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.3.1",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "extglob": "^2.0.4",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^6.0.2",
+ "nanomatch": "^1.2.9",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.2"
+ }
+ },
+ "mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "dev": true
+ },
+ "mime-db": {
+ "version": "1.44.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
+ "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
+ "dev": true
+ },
+ "mime-types": {
+ "version": "2.1.27",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
+ "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
+ "dev": true,
+ "requires": {
+ "mime-db": "1.44.0"
+ }
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
+ "dev": true
+ },
+ "mixin-deep": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
+ "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
+ "dev": true,
+ "requires": {
+ "for-in": "^1.0.2",
+ "is-extendable": "^1.0.1"
+ },
+ "dependencies": {
+ "is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dev": true,
+ "requires": {
+ "is-plain-object": "^2.0.4"
+ }
+ }
+ }
+ },
+ "mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "dev": true
+ },
+ "moment": {
+ "version": "2.29.1",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
+ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "nanomatch": {
+ "version": "1.2.13",
+ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
+ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "fragment-cache": "^0.2.1",
+ "is-windows": "^1.0.2",
+ "kind-of": "^6.0.2",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ }
+ },
+ "ncp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
+ "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
+ "dev": true
+ },
+ "negotiator": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
+ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==",
+ "dev": true
+ },
+ "neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
+ "dev": true
+ },
+ "nopt": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
+ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
+ "dev": true,
+ "requires": {
+ "abbrev": "1"
+ }
+ },
+ "normalize-url": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
+ "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=",
+ "dev": true,
+ "requires": {
+ "object-assign": "^4.0.1",
+ "prepend-http": "^1.0.0",
+ "query-string": "^4.1.0",
+ "sort-keys": "^1.0.0"
+ }
+ },
+ "nth-check": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
+ "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
+ "dev": true,
+ "requires": {
+ "boolbase": "~1.0.0"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "dev": true
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+ "dev": true
+ },
+ "object-copy": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
+ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
+ "dev": true,
+ "requires": {
+ "copy-descriptor": "^0.1.0",
+ "define-property": "^0.2.5",
+ "kind-of": "^3.0.3"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "object-visit": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
+ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.0"
+ }
+ },
+ "object.defaults": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
+ "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
+ "dev": true,
+ "requires": {
+ "array-each": "^1.0.1",
+ "array-slice": "^1.0.0",
+ "for-own": "^1.0.0",
+ "isobject": "^3.0.0"
+ }
+ },
+ "object.map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
+ "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
+ "dev": true,
+ "requires": {
+ "for-own": "^1.0.0",
+ "make-iterator": "^1.0.0"
+ }
+ },
+ "object.pick": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
+ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.1"
+ }
+ },
+ "on-finished": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+ "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
+ "dev": true,
+ "requires": {
+ "ee-first": "1.1.1"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-homedir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+ "dev": true
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+ "dev": true
+ },
+ "osenv": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
+ "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
+ "dev": true,
+ "requires": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.2.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "parse-filepath": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
+ "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
+ "dev": true,
+ "requires": {
+ "is-absolute": "^1.0.0",
+ "map-cache": "^0.2.0",
+ "path-root": "^0.1.1"
+ }
+ },
+ "parse-passwd": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
+ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
+ "dev": true
+ },
+ "parse-srcset": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz",
+ "integrity": "sha1-8r0iH2zJcKk42IVWq8WJyqqiveE=",
+ "dev": true
+ },
+ "parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "dev": true
+ },
+ "pascalcase": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
+ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "path-parse": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
+ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+ "dev": true
+ },
+ "path-root": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
+ "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
+ "dev": true,
+ "requires": {
+ "path-root-regex": "^0.1.0"
+ }
+ },
+ "path-root-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
+ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=",
+ "dev": true
+ },
+ "path-to-regexp": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
+ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=",
+ "dev": true
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ },
+ "pinkie": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+ "dev": true
+ },
+ "pinkie-promise": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+ "dev": true,
+ "requires": {
+ "pinkie": "^2.0.0"
+ }
+ },
+ "pkg-dir": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+ "dev": true,
+ "requires": {
+ "find-up": "^4.0.0"
+ }
+ },
+ "posix-character-classes": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
+ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
+ "dev": true
+ },
+ "postcss": {
+ "version": "7.0.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
+ "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "prepend-http": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
+ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
+ "dev": true
+ },
+ "pretty-bytes": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz",
+ "integrity": "sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "proxy-addr": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
+ "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
+ "dev": true,
+ "requires": {
+ "forwarded": "~0.1.2",
+ "ipaddr.js": "1.9.1"
+ }
+ },
+ "qs": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
+ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
+ "dev": true
+ },
+ "query-string": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
+ "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
+ "dev": true,
+ "requires": {
+ "object-assign": "^4.1.0",
+ "strict-uri-encode": "^1.0.0"
+ }
+ },
+ "range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "dev": true
+ },
+ "raw-body": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
+ "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
+ "dev": true,
+ "requires": {
+ "bytes": "3.1.0",
+ "http-errors": "1.7.2",
+ "iconv-lite": "0.4.24",
+ "unpipe": "1.0.0"
+ }
+ },
+ "readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ },
+ "rechoir": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+ "dev": true,
+ "requires": {
+ "resolve": "^1.1.6"
+ }
+ },
+ "regex-not": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
+ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^3.0.2",
+ "safe-regex": "^1.1.0"
+ }
+ },
+ "repeat-element": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
+ "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==",
+ "dev": true
+ },
+ "repeat-string": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
+ "dev": true
+ },
+ "requizzle": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz",
+ "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.14"
+ }
+ },
+ "resolve": {
+ "version": "1.19.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
+ "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
+ "dev": true,
+ "requires": {
+ "is-core-module": "^2.1.0",
+ "path-parse": "^1.0.6"
+ }
+ },
+ "resolve-dir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
+ "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
+ "dev": true,
+ "requires": {
+ "expand-tilde": "^2.0.0",
+ "global-modules": "^1.0.0"
+ }
+ },
+ "resolve-url": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
+ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
+ "dev": true
+ },
+ "ret": {
+ "version": "0.1.15",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
+ "dev": true
+ },
+ "rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "dev": true
+ },
+ "safe-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
+ "dev": true,
+ "requires": {
+ "ret": "~0.1.10"
+ }
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true
+ },
+ "sanitize-html": {
+ "version": "1.27.5",
+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.27.5.tgz",
+ "integrity": "sha512-M4M5iXDAUEcZKLXkmk90zSYWEtk5NH3JmojQxKxV371fnMh+x9t1rqdmXaGoyEHw3z/X/8vnFhKjGL5xFGOJ3A==",
+ "dev": true,
+ "requires": {
+ "htmlparser2": "^4.1.0",
+ "lodash": "^4.17.15",
+ "parse-srcset": "^1.0.2",
+ "postcss": "^7.0.27"
+ },
+ "dependencies": {
+ "dom-serializer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.1.0.tgz",
+ "integrity": "sha512-ox7bvGXt2n+uLWtCRLybYx60IrOlWL/aCebWJk1T0d4m3y2tzf4U3ij9wBMUb6YJZpz06HCCYuyCDveE2xXmzQ==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^2.0.1",
+ "domhandler": "^3.0.0",
+ "entities": "^2.0.0"
+ }
+ },
+ "domelementtype": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.2.tgz",
+ "integrity": "sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA==",
+ "dev": true
+ },
+ "domhandler": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz",
+ "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^2.0.1"
+ }
+ },
+ "domutils": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.2.tgz",
+ "integrity": "sha512-NKbgaM8ZJOecTZsIzW5gSuplsX2IWW2mIK7xVr8hTQF2v1CJWTmLZ1HOCh5sH+IzVPAGE5IucooOkvwBRAdowA==",
+ "dev": true,
+ "requires": {
+ "dom-serializer": "^1.0.1",
+ "domelementtype": "^2.0.1",
+ "domhandler": "^3.3.0"
+ }
+ },
+ "entities": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
+ "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
+ "dev": true
+ },
+ "htmlparser2": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz",
+ "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^2.0.1",
+ "domhandler": "^3.0.0",
+ "domutils": "^2.0.0",
+ "entities": "^2.0.0"
+ }
+ }
+ }
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ },
+ "send": {
+ "version": "0.17.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
+ "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
+ "depd": "~1.1.2",
+ "destroy": "~1.0.4",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "~1.7.2",
+ "mime": "1.6.0",
+ "ms": "2.1.1",
+ "on-finished": "~2.3.0",
+ "range-parser": "~1.2.1",
+ "statuses": "~1.5.0"
+ },
+ "dependencies": {
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "dev": true
+ }
+ }
+ },
+ "serve-static": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
+ "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
+ "dev": true,
+ "requires": {
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "0.17.1"
+ }
+ },
+ "set-value": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
+ "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "is-extendable": "^0.1.1",
+ "is-plain-object": "^2.0.3",
+ "split-string": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "setprototypeof": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
+ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
+ "dev": true
+ },
+ "snapdragon": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
+ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
+ "dev": true,
+ "requires": {
+ "base": "^0.11.1",
+ "debug": "^2.2.0",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "map-cache": "^0.2.2",
+ "source-map": "^0.5.6",
+ "source-map-resolve": "^0.5.0",
+ "use": "^3.1.0"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "snapdragon-node": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
+ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
+ "dev": true,
+ "requires": {
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.0",
+ "snapdragon-util": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
+ }
+ },
+ "snapdragon-util": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
+ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.2.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "sort-keys": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
+ "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
+ "dev": true,
+ "requires": {
+ "is-plain-obj": "^1.0.0"
+ }
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ },
+ "source-map-resolve": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
+ "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+ "dev": true,
+ "requires": {
+ "atob": "^2.1.2",
+ "decode-uri-component": "^0.2.0",
+ "resolve-url": "^0.2.1",
+ "source-map-url": "^0.4.0",
+ "urix": "^0.1.0"
+ }
+ },
+ "source-map-support": {
+ "version": "0.5.19",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
+ "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "dev": true,
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
+ "source-map-url": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
+ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
+ "dev": true
+ },
+ "split-string": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
+ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^3.0.0"
+ }
+ },
+ "sprintf-js": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
+ "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
+ "dev": true
+ },
+ "static-extend": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
+ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
+ "dev": true,
+ "requires": {
+ "define-property": "^0.2.5",
+ "object-copy": "^0.1.0"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ }
+ }
+ },
+ "statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
+ "dev": true
+ },
+ "strict-uri-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
+ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
+ "dev": true
+ },
+ "string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "~5.2.0"
+ },
+ "dependencies": {
+ "safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true
+ }
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "strip-outer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
+ "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
+ "strip-url-auth": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz",
+ "integrity": "sha1-IrD6OkE4WzO+PzMVUbu4N/oM164=",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "taffydb": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz",
+ "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=",
+ "dev": true
+ },
+ "terser": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.0.tgz",
+ "integrity": "sha512-eopt1Gf7/AQyPhpygdKePTzaet31TvQxXvrf7xYUvD/d8qkCJm4SKPDzu+GHK5ZaYTn8rvttfqaZc3swK21e5g==",
+ "dev": true,
+ "requires": {
+ "commander": "^2.20.0",
+ "source-map": "~0.7.2",
+ "source-map-support": "~0.5.19"
+ },
+ "dependencies": {
+ "commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+ "dev": true
+ }
+ }
+ },
+ "to-object-path": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
+ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "to-regex": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
+ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
+ "dev": true,
+ "requires": {
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "regex-not": "^1.0.2",
+ "safe-regex": "^1.1.0"
+ }
+ },
+ "to-regex-range": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
+ "dev": true,
+ "requires": {
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1"
+ }
+ },
+ "toidentifier": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
+ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
+ "dev": true
+ },
+ "trim-repeated": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
+ "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
+ "type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "dev": true,
+ "requires": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ }
+ },
+ "uc.micro": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
+ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
+ "dev": true
+ },
+ "uglify-js": {
+ "version": "3.4.10",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
+ "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==",
+ "dev": true,
+ "requires": {
+ "commander": "~2.19.0",
+ "source-map": "~0.6.1"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
+ "unc-path-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
+ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=",
+ "dev": true
+ },
+ "underscore": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz",
+ "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==",
+ "dev": true
+ },
+ "underscore.string": {
+ "version": "3.3.5",
+ "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz",
+ "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==",
+ "dev": true,
+ "requires": {
+ "sprintf-js": "^1.0.3",
+ "util-deprecate": "^1.0.2"
+ }
+ },
+ "union-value": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+ "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
+ "dev": true,
+ "requires": {
+ "arr-union": "^3.1.0",
+ "get-value": "^2.0.6",
+ "is-extendable": "^0.1.1",
+ "set-value": "^2.0.1"
+ }
+ },
+ "universalify": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "dev": true
+ },
+ "unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
+ "dev": true
+ },
+ "unset-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
+ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
+ "dev": true,
+ "requires": {
+ "has-value": "^0.3.1",
+ "isobject": "^3.0.0"
+ },
+ "dependencies": {
+ "has-value": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
+ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
+ "dev": true,
+ "requires": {
+ "get-value": "^2.0.3",
+ "has-values": "^0.1.4",
+ "isobject": "^2.0.0"
+ },
+ "dependencies": {
+ "isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "requires": {
+ "isarray": "1.0.0"
+ }
+ }
+ }
+ },
+ "has-values": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
+ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
+ "dev": true
+ }
+ }
+ },
+ "uri-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz",
+ "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=",
+ "dev": true
+ },
+ "urix": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
+ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
+ "dev": true
+ },
+ "use": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
+ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
+ "dev": true
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+ "dev": true
+ },
+ "utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
+ "dev": true
+ },
+ "v8flags": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz",
+ "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==",
+ "dev": true,
+ "requires": {
+ "homedir-polyfill": "^1.0.1"
+ }
+ },
+ "vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
+ "dev": true
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
+ "dev": true
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "xmlcreate": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz",
+ "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==",
+ "dev": true
+ }
+ }
+}
diff --git a/package.json b/package.json
index acc2ca6..47119c7 100644
--- a/package.json
+++ b/package.json
@@ -1,42 +1,42 @@
-{
- "name": "dtps",
- "description": "A better UI for Canvas LMS",
- "scripts": {
- "start": "node server.js",
- "build": "node build.js",
- "predeploy": "npm run build",
- "deploy": "gh-pages -d build -m \"npm deploy\"",
- "predev": "npm run build -- --dev",
- "dev": "gh-pages -d build -m \"npm dev\" -r [email protected]:jottocraft/dtps-dev.git -b main",
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/jottocraft/dtps.git"
- },
- "keywords": [
- "canvas-lms",
- "chrome-extension",
- "javascript",
- "html",
- "website",
- "epic"
- ],
- "author": "jottocraft",
- "license": "GPL-2.0",
- "bugs": {
- "url": "https://github.com/jottocraft/dtps/issues"
- },
- "homepage": "https://powerplus.app",
- "devDependencies": {
- "express": "^4.17.1",
- "foodoc": "0.0.9",
- "gh-pages": "^3.1.0",
- "glob": "^7.1.6",
- "jsdoc": "^3.6.6",
- "mkdirp": "^1.0.4",
- "ncp": "^2.0.0",
- "rimraf": "^3.0.2",
- "terser": "^5.3.2"
- }
-}
+{
+ "name": "dtps",
+ "description": "A better UI for Canvas LMS",
+ "scripts": {
+ "start": "node server.js",
+ "build": "node build.js",
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build -m \"npm deploy\"",
+ "predev": "npm run build -- --dev",
+ "dev": "gh-pages -d build -m \"npm dev\" -r [email protected]:jottocraft/dtps-dev.git -b main",
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jottocraft/dtps.git"
+ },
+ "keywords": [
+ "canvas-lms",
+ "chrome-extension",
+ "javascript",
+ "html",
+ "website",
+ "epic"
+ ],
+ "author": "jottocraft",
+ "license": "GPL-2.0",
+ "bugs": {
+ "url": "https://github.com/jottocraft/dtps/issues"
+ },
+ "homepage": "https://powerplus.app",
+ "devDependencies": {
+ "express": "^4.17.1",
+ "foodoc": "0.0.9",
+ "gh-pages": "^3.1.0",
+ "glob": "^7.1.6",
+ "jsdoc": "^3.6.6",
+ "mkdirp": "^1.0.4",
+ "ncp": "^2.0.0",
+ "rimraf": "^3.0.2",
+ "terser": "^5.3.2"
+ }
+}
diff --git a/scripts/assignments.js b/scripts/assignments.js
index c479136..f9bf66a 100644
--- a/scripts/assignments.js
+++ b/scripts/assignments.js
@@ -1,1266 +1,1266 @@
-/**
- * @file DTPS assignment functions
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-/**
- * Renders HTML for an assignment item in a list
- *
- * @param {Assignment} assignment The assignment object to render
- * @param {string} [childDisplay] Text to display for specifying the child or children this assignment is for
- * @return {string} Assignment HTML for use in a list
- */
-dtps.renderAssignment = function (assignment, childDisplay) {
- //Render points/letter score
- var scoreHTML = dtps.renderAssignmentScore(assignment);
-
- var HTML = /*html*/`
- <div
- onclick="${`dtps.assignment('` + assignment.id + `', ` + assignment.class + `, ` + (!isNaN(childDisplay) ? true : false) + `)`}"
- class="card ${scoreHTML ? "graded assignment" : "assignment"}"
- style="${'--classColor: ' + dtps.classes[assignment.class].color}"
- >
-
- <!-- Color bar for the dashboard -->
- <div class="colorBar"></div>
-
- <!-- Assignment title and points -->
- <h4>
- <span>${assignment.title}</span>
-
- <!-- Points display -->
- ${scoreHTML ? `<div class="points">${scoreHTML}</div>` : ``}
- </h4>
-
- <h5>
- <!-- Assignment info -->
- <div class="info">
- ${assignment.dueAt ? `<div ${dtpsLMS.isUsualDueDate && !dtpsLMS.isUsualDueDate(assignment.dueAt) ? `style="font-weight: bold;color: var(--text);"` : ""} class="infoChip"><i style="margin-top: -2px;" class="material-icons">alarm</i> Due ` + dtps.formatDate(assignment.dueAt) + `</div>` : ""}
- ${assignment.outcomes ? `<div class="infoChip weighted"><i class="material-icons">adjust</i>` + assignment.outcomes.length + `</div>` : ""}
- ${assignment.category ? `<div class="infoChip weighted"><i class="material-icons">category</i> ` + assignment.category + `</div>` : ""}
- ${childDisplay ? `<div class="infoChip weighted"><i class="material-icons">person</i> ` + childDisplay + `</div>` : ""}
- </div>
-
- <!-- Status icons -->
- <div class="status">
- ${assignment.turnedIn ? `<i title="Assignment submitted" class="material-icons statusIcon" style="color: #0bb75b;">assignment_turned_in</i>` : ``}
- ${assignment.missing ? `<i title="Assignment is missing" class="material-icons statusIcon" style="color: #c44848;">remove_circle_outline</i>` : ``}
- ${assignment.late ? `<i title="Assignment is late" class="material-icons statusIcon" style="color: #c44848;">assignment_late</i>` : ``}
- ${assignment.locked ? `<i title="Assignment submissions are locked" class="material-icons statusIcon" style="color: var(--secText, gray);">lock_outline</i>` : ``}
- ${assignment.pending ? `<i title="Grade is pending review" class="material-icons statusIcon" style="color: #b3b70b;">rate_review</i>` : ``}
- </div>
- </h5>
- </div>
- `;
-
- return HTML;
-}
-
-/**
-* Renders HTML for an assignment score if the assignment is graded
-*
-* @param {Assignment} assignment The assignment object to render a score for
-* @return {string} Assignment score HTML
-*/
-dtps.renderAssignmentScore = function (assignment) {
- var scoreHTML = "";
-
- //Use rubric score over points score if possible
- if (dtpsLMS.useRubricGrades && assignment.rubric) {
- var rubricHTML = [];
-
- assignment.rubric.forEach(rubricItem => {
- if (rubricItem.score !== undefined) {
- rubricHTML.push(/*html*/`
- <div title="${rubricItem.title}" style="color: ${rubricItem.color || "var(--text)"};">
- ${rubricItem.score}
- </div>
- `);
- }
- });
-
- if (rubricHTML.length) scoreHTML = `<div class="dtpsRubricScore">${rubricHTML.join("")}</div>`;
-
- } else if (!dtpsLMS.useRubricGrades && (assignment.grade || (assignment.grade == 0))) {
- scoreHTML = /*html*/`
- <div class="assignmentGrade">
- <div class="grade">${Number(assignment.grade.toFixed(2))}</div>
- <div class="value">/${Number(assignment.value.toFixed(2))}</div>
- ${assignment.letter ? `<div class="letter">${assignment.letter.replace("incomplete", `<i class="material-icons">cancel</i>`).replace("complete", `<i class="material-icons">done</i>`)}</div>` : ""}
- <div class="percentage">${Math.round((assignment.grade / assignment.value) * 100)}%</div>
- </div>
- `;
- }
-
- return scoreHTML;
-}
-
-/**
-* Merges and renders assignments for children in the same class
-*
-* @param {Assignment[]} assignments An array of assignment objects to merge
-* @return {string} HTML with the assignments merged and labelled
-*/
-dtps.mergeAndRenderChildAssignments = function (assignments) {
- var assignmentGroups = [];
-
- assignments.forEach(assignment => {
- var matchedGroup = false;
- assignmentGroups.forEach(group => {
- var groupAssignment = group[0];
-
- //Check if assignment matches group assignment
- var matchKeys = ["id", "dueAt", "locked", "category", "turnedIn", "late", "missing", "grade", "value", "letter"];
- var matches = 0;
- matchKeys.forEach(k => {
- if (assignment[k] == groupAssignment[k]) matches++;
- });
-
- if (matches == matchKeys.length) {
- matchedGroup = true;
- group.push(assignment);
- }
- });
-
- if (!matchedGroup) {
- assignmentGroups.push([assignment]);
- }
- });
-
- return assignmentGroups.map(g => {
- return dtps.renderAssignment(g[0], g.length == 1 ? dtps.user.children.find(c => c.id == dtps.classes[g[0].class].userID).name : g.length);
- }).join("");
-}
-
-/**
- * Renders the DTPS dashboard and calls dtps.renderCalendar, dtps.renderUpdates, and dtps.renderUpcoming
- */
-dtps.mainStream = function () {
- //Ensure classes are rendered in the sidebar
- dtps.presentClass("dash");
- dtps.showClasses();
-
- //Clear active state from all tabs
- $("#dtpsTabBar .btn").removeClass("active");
-
- //Count amount of classes that are loaded
- var ready = 0;
- dtps.classes.forEach(course => {
- if (course.assignments) ready++;
- });
-
- //Check if all classes are loaded
- var doneLoading = ready == dtps.classes.length;
-
- //Returns dashboard item container HTML for an item
- function dashboardContainerHTML(dashboardItem) {
- if (dashboardItem.id == "dtps.calendar") {
- return window.FullCalendar ? `<div id="calendar" class="card" style="padding: 20px;"></div>` : "";
- } else if (dashboardItem.id == "dtps.updates") {
- return `<div class="updatesStream recentlyGraded announcements"></div>`;
- } else if (dashboardItem.id == "dtps.dueToday") {
- return `<div style="padding: 20px 0px;" class="dueToday"></div>`;
- } else if (dashboardItem.id == "dtps.upcoming") {
- return `<div style="padding: 20px 0px;" class="assignmentStream"></div>`;
- }
- }
-
- //Render HTML with loading placeholder
- if (dtps.selectedClass == "dash") {
- jQuery(".classContent").html(/*html*/`
- <div style="letter-spacing: 0px;">
- <div style="float: left; width: 45%; display: inline-block;" class="dash">
- ${dtps.leftDashboard.map(dashboardItem => {
- return dashboardContainerHTML(dashboardItem);
- }).join("")}
- </div>
-
- <div style="float: left; width: 55%; display: inline-block;" class="dash">
- ${!doneLoading ? `<div style="margin: 75px 25px 10px 75px;"><div class="spinner"></div></div>` : ""}
- ${dtps.rightDashboard.map(dashboardItem => {
- return dashboardContainerHTML(dashboardItem);
- }).join("")}
- </div>
- </div>
- `);
- }
-
- //Render updates stream
- dtps.renderUpdates();
-
- //Render upcoming assignments stream
- dtps.renderUpcoming();
-
- //Render calendar
- dtps.calendar(doneLoading);
-
- //Render due today
- dtps.renderDueToday(doneLoading);
-}
-
-/**
- * Checks if a due date is on a date
- *
- * @param {Date} date Date to check
- * @param {Date} [onDate] Date checked against (defaults to today)
- */
-dtps.isDueOnDate = function (date, onDate) {
- var today = onDate ? new Date(onDate) : new Date();
- var tomorrow = new Date(today.getTime() + 86400000);
- var d1 = new Date(date);
-
- var isActuallyTodayAfter9 = d1.getFullYear() === today.getFullYear() &&
- d1.getMonth() === today.getMonth() &&
- d1.getDate() === today.getDate() &&
- d1.getHours() >= 9;
-
- var isTomorrowBefore9 = d1.getFullYear() === tomorrow.getFullYear() &&
- d1.getMonth() === tomorrow.getMonth() &&
- d1.getDate() === tomorrow.getDate() &&
- d1.getHours() < 9;
-
- return isActuallyTodayAfter9 || isTomorrowBefore9;
-}
-
-/**
- * Compiles and displays due today / to-do stream
- *
- * @param {boolean} doneLoading True if all classes have finished loading their assignment lists
- * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
- */
-dtps.renderDueToday = function (doneLoading, fromDate) {
- //Combine class stream arrays
- var combinedStream = [];
- if (dtps.classes) {
- dtps.classes.forEach(course => {
- if (course.assignments) {
- //If course has assignments, add them to the combined stream array
- course.assignments.forEach(assignment => {
- //Only assignments that are due today
- if (dtps.isDueOnDate(assignment.dueAt, fromDate)) {
- combinedStream.push(assignment);
- }
- })
- }
- })
- }
-
- //Sort combined stream by date
- combinedStream.sort(function (a, b) {
- var keyA = new Date(a.dueAt).getTime(),
- keyB = new Date(b.dueAt).getTime();
-
- // Compare the 2 dates
- if (keyA > keyB) return 1;
- if (keyA < keyB) return -1;
- return 0;
- });
-
- //Get due today stream HTML
- if (dtps.user.parent) {
- var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
- } else {
- var combinedHTML = combinedStream.map(assignment => {
- return dtps.renderAssignment(assignment);
- }).join("");
- }
-
- if (combinedStream.length == 0) {
- //Nothing due today
- if (doneLoading) {
- combinedHTML = `<p style="text-align: center;margin: 10px 0px; font-size: 18px;"><i class="material-icons">done</i> ${fromDate ? "Nothing is due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Nothing is due today"}</p>`;
- } else {
- combinedHTML = ``;
- }
- } else {
- //Add header
- combinedHTML = /*html*/`
- <h5 style="text-align: center; margin: 10px 0px; font-weight: bold;">${fromDate ? "Due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Due Today"}</h5>
- ` + combinedHTML;
- }
-
- if (dtps.selectedClass == "dash") {
- jQuery(".classContent .dash .dueToday").html(combinedHTML);
- }
-}
-
-/**
- * Compiles and displays upcoming assignments stream
- *
- * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
- */
-dtps.renderUpcoming = function (fromDate) {
- //Combine class stream arrays
- var today = fromDate ? new Date(fromDate) : new Date();
- var combinedStream = [];
- if (dtps.classes) {
- dtps.classes.forEach(course => {
- if (course.assignments) {
- //If course has assignments, add them to the combined stream array
- course.assignments.forEach(assignment => {
- //Only include upcoming assignments that aren't due today
- if ((new Date(assignment.dueAt).getTime() > today.getTime()) && !dtps.isDueOnDate(assignment.dueAt, today)) {
- combinedStream.push(assignment);
- }
- })
- }
- })
- }
-
- //Sort combined stream by date
- combinedStream.sort(function (a, b) {
- var keyA = new Date(a.dueAt).getTime(),
- keyB = new Date(b.dueAt).getTime();
-
- // Compare the 2 dates
- if (keyA > keyB) return 1;
- if (keyA < keyB) return -1;
- return 0;
- });
-
- //Limit stream length to 30 assignments
- if (combinedStream.length > 30) {
- combinedStream.length = 30;
- }
-
- //Render upcoming assignments stream
- if (dtps.user.parent) {
- var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
- } else {
- var combinedHTML = combinedStream.map(assignment => {
- return dtps.renderAssignment(assignment);
- }).join("");
- }
-
- //No upcoming assignments
- if (combinedStream.length == 0) {
- combinedHTML = "";
- }
-
- if (dtps.selectedClass == "dash") {
- jQuery(".classContent .dash .assignmentStream").html(combinedHTML);
- }
-}
-
-/**
- * Renders updates stream (recently graded & announcements)
- *
- * @param {boolean} [dateSelected] True if a date is selected in the dashboard
- */
-dtps.renderUpdates = function (dateSelected) {
- //Get updates HTML
- var updatesHTML = "";
-
- if (dtps.remoteConfig.remoteUpdate.active) {
- markdown = new showdown.Converter();
- updatesHTML += /*html*/`
- <div style="cursor: auto; padding: 20px; --classColor: var(--secText);" class="announcement card open">
- <div class="className">
- <img src="${dtps.baseURL + "/icon.svg"}" style="vertical-align: middle;width: 22px;margin-right: 5px;" />
- <span style="font-weight: bold; vertical-align: middle; color: var(--text); font-size: 18px;">${dtps.remoteConfig.remoteUpdate.title}</span>
- </div>
- ${markdown.makeHtml(dtps.remoteConfig.remoteUpdate.md)}
- </div>
- `;
- }
-
- if (dateSelected && (dtps.selectedClass == "dash")) {
- return jQuery(".classContent .dash .updatesStream").html(/*html*/`
- <div style="cursor: auto; padding: 20px; --classColor: var(--secText);" class="announcement card open">
- <div class="className">Date Selected</div>
- <p>Updates are not shown while a date is selected</p>
- </div>
- `);
- }
-
- dtps.updates.forEach(update => {
- if (update.type == "announcement") {
- updatesHTML += /*html*/`
- <div onclick="$(this).toggleClass('open');" style="cursor: pointer; padding: 20px; --classColor: ${dtps.classes[update.class].color};" class="announcement card">
- <div class="className">${update.title}</div>
- ${update.body}
- </div>
- `;
- } else if (update.type == "assignment") {
- var scoreHTML = dtps.renderAssignmentScore(update);
- updatesHTML += /*html*/`
- <div onclick="dtps.assignment('${update.id}', ${update.class})" style="--classColor: ${dtps.classes[update.class].color};" class="card recentGrade">
- <h5>
- <span>${update.title}</span>
-
- <!-- Points display -->
- ${scoreHTML ? `<div class="points">${scoreHTML}</div>` : ``}
- </h5>
-
- <p>${dtps.user.parent ? "Graded for " + dtps.user.children.find(c => c.id == dtps.classes[update.class].userID).name : "Graded"} at ${dtps.formatDate(update.gradedAt)}</p>
- </div>
- `;
- }
- })
-
- if (dtps.selectedClass == "dash") {
- jQuery(".classContent .dash .updatesStream").html(updatesHTML);
- }
-}
-
-
-/**
- * Compiles and displays the assignment calendar
- *
- * @param {boolean} doneLoading True if all classes have finished loading their assignment lists
- */
-dtps.calendar = function (doneLoading) {
- if (dtps.selectedClass == "dash") {
- //Calendar events array
- var calEvents = [];
-
- //Add assignments from every class to calEvents array
- dtps.classes.forEach((course, courseIndex) => {
- if (course.assignments) {
- //Class has assignments
- course.assignments.forEach(assignment => {
- //Show assignments due before 9AM on the previous day
- var date = new Date(assignment.dueAt);
- if (date.getHours() < 9) {
- //Set the date to 23:59 the previous day for calendar display
- date.setTime(date.getTime() - 86400000);
- date.setHours(23);
- date.setMinutes(59);
- }
-
- var existingEvent = calEvents.find(e => e.id == assignment.id);
- if (existingEvent && assignment.missing) {
- //Mark existing event as missing and link to missing assignment
- existingEvent.missing = true;
- existingEvent.borderColor = "#c44848";
- existingEvent.assignmentID = assignment.id;
- existingEvent.classNum = courseIndex;
- } else if (!existingEvent) {
- calEvents.push({
- title: assignment.title,
- start: date,
- id: assignment.id,
- allDay: true,
- backgroundColor: course.color,
- borderColor: (assignment.missing === true) ? '#c44848' : 'transparent',
- textColor: "white",
- classNum: courseIndex,
- assignmentID: assignment.id,
- missing: assignment.missing
- });
- }
- });
- }
- });
-
- //Render calendar
- if (window.FullCalendar) {
- var calendarEl = document.getElementById('calendar');
- calendar = new FullCalendar.Calendar(calendarEl, {
- locale: "en",
- initialView: 'dayGridMonth',
- events: calEvents,
- eventContent: info => {
- const { missing } = info.event.extendedProps;
- const html = /*html*/`
- <div class='fc-event-main-frame'>
- <div class='fc-event-title-container'>
- <div class='fc-event-title fc-sticky'>
- ${missing ? `<i title="Assignment is missing" class="material-icons statusIcon">remove_circle_outline</i>` : ``}
- <span style="vertical-align: middle;">${info.event.title}</span>
- </div>
- </div>
- </div>
- `;
- return { html };
- },
- contentHeight: 0,
- handleWindowResize: false,
- headerToolbar: {
- start: 'title',
- center: '',
- end: 'prev,next'
- },
- dateClick: function (info) {
- if ($(info.dayEl).hasClass("fc-day-today")) return fluid.screen();
-
- //Update calendar
- $("#calendar .fc-daygrid-day").removeClass("active");
- $(info.dayEl).addClass("active");
- $("#calendar").addClass("dateSelected");
-
- //Display selected date
- $(".headerArea .contentLabel i").text("event");
- $(".headerArea .contentLabel span").text("Showing assignments from " + info.date.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }));
- $(".headerArea .contentLabel").show();
-
- //Re-render dashboard from the selected date
- dtps.renderDueToday(doneLoading, info.date);
- dtps.renderUpcoming(info.date);
- dtps.renderUpdates(true);
- },
- eventClick: function (info) {
- dtps.assignment(info.event.extendedProps.assignmentID, info.event.extendedProps.classNum);
- }
- });
- calendar.render();
- }
- }
-}
-
-/**
- * Shows the assignments stream for a class
- *
- * @param {string} classID The class ID to show assignments for
- * @param {Assignment[]} [searchResults] An array of assignemnts to render instead of course.assignments. Used for assignment search.
- */
-dtps.classStream = function (classID, searchResults) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(classID);
- dtps.selectedClass = classNum;
-
- //Set stream as the selected content
- dtps.selectedContent = "stream";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.stream").addClass("active");
-
- //Save coursework stream preference
- window.localStorage.setItem("courseworkPref-" + classID, "stream");
-
- //Load class color, name, etc.
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.classStream");
- }
-
- //Use search results to render or render all class assignments
- var assignments = searchResults || dtps.classes[classNum].assignments;
-
- //Render assignments
- if (!assignments) {
- //Assignments are still loading
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- jQuery(".classContent").html(dtps.renderStreamTools(classNum, "stream") + [1, 2, 3, 4].map(() => (
- /*html*/`
- <div class="card assignment graded">
- <h4>
- <span style="width: 450px;" class="shimmer">Assignment Title</span>
- <div class="points shimmer">00/00</div>
- </h4>
-
- <h5 style="white-space: nowrap; overflow: hidden;">
- <div style="width: 200px;" class="infoChip shimmer"></div>
- <i class="material-icons statusIcon shimmer">more_horiz</i>
- </h5>
- </div>
- `
- )).join(""));
- }
- } else if (assignments.length == 0) {
- //This class doesn't have any assignments
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- $(".classContent").html(dtps.renderStreamTools(classNum, "stream") + /*html*/`
- <div style="text-align: center;">
- <div style="margin: 60px; padding: 20px 40px; display: inline-block; border: 2px solid var(--elements); border-radius: var(--elementRadius);">
- <h5>No Assignments</h5>
- <p>There aren't any assignments in this class yet.</p>
- </div>
- </div>
- `);
- }
- } else {
- //Sort assignments
- assignments.sort(function (a, b) {
- var keyA = new Date(a.dueAt).getTime(),
- keyB = new Date(b.dueAt).getTime();
-
- var now = new Date().getTime();
-
- //Put assignments without a due date at the end
- if (!a.dueAt) { keyA = 0; }
- if (!b.dueAt) { keyB = 0; }
-
- //Put upcoming assignments at the top
- if ((keyA < now) || (keyB < now)) {
- // Sort upcoming assignments from earliest -> latest
- if (keyA < keyB) return 1;
- if (keyA > keyB) return -1;
- return 0;
- } else {
- // Sort old assignments from latest -> earliest
- if (keyA > keyB) return 1;
- if (keyA < keyB) return -1;
- return 0;
- }
- });
-
- //Render assignments
- var prevAssignment = null;
- var streamHTML = assignments.map(assignment => {
- var divider = "";
-
- if (!assignment.dueAt) {
- if (prevAssignment && (prevAssignment !== "undated")) {
- divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Undated Assignments</h5>`;
- }
-
- prevAssignment = "undated";
- } else if (new Date(assignment.dueAt) < new Date()) {
- if (prevAssignment && (prevAssignment !== "old")) {
- divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Old Assignments</h5>`;
- }
-
- prevAssignment = "old";
- } else {
- prevAssignment = "upcoming";
- }
-
- return divider + dtps.renderAssignment(assignment);
- }).join("");
-
- //Add stream header with class info buttons and search box
- streamHTML = dtps.renderStreamTools(classNum, "stream") + streamHTML;
-
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
- $(".classContent").html(streamHTML);
- }
- }
-}
-
-/**
- * Shows details for an assignment given the assignment ID and class number
- *
- * @param {string} id Assignment ID
- * @param {number} classNum Assignment class number
- * @param {boolean} [generic] True if user-specific details, such as grades, should not be displayed
- */
-dtps.assignment = function (id, classNum, generic) {
- //Get assignment from the id prop
- var assignmentIDs = dtps.classes[classNum].assignments.map(assignment => assignment.id);
- var assignment = dtps.classes[classNum].assignments[assignmentIDs.indexOf(id)];
-
- //The assignment body is rendered in an iFrame to keep its content and styling isolated from the rest of the page
- var assignmentBodyHTML = null;
- if (assignment.body) {
- //Get computed background and text color to style the iFrame with
- var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
- var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
-
- var body = assignment.body;
- if ($("body").hasClass("dark")) {
- body = dtps.brightenTextForDarkMode(assignment.body, computedBackgroundColor);
- }
-
- var hasKeywords = false;
- if (body.toLowerCase().includes("deliverable") && body.toLowerCase().includes("instruction") && body.toLowerCase().includes("look for")) hasKeywords = true;
- if ((fluid.get('pref-formatAssignmentContent') !== "false") && dtpsLMS.dtech && hasKeywords && ($('<div></div>').append(body).children("table").find("tbody tr").length > 1)) {
- var sections = [];
- $('<div></div>').append(body).children("table").find("tbody tr").toArray().forEach((element, i) => {
- var text = $(element).find("h4:first-child").text().toLowerCase();
- if (!text) return;
-
- var tmpjQuery = $(element);
- tmpjQuery.find("h4:first-child").remove();
- var innerHTML = tmpjQuery.html();
- if (!innerHTML) return;
-
- var icon = null;
- if (text.includes("deliverable")) { icon = "description"; text = "Deliverables"; }
- if (text.includes("instruction")) { icon = "assignment"; text = "Instructions"; }
- if (text.includes("look for")) { icon = "find_in_page"; text = "Look Fors"; }
-
- sections.push({ text, icon, innerHTML });
- });
-
- var tmpjQuery = $('<div></div>').append(body);
- tmpjQuery.children("table").replaceWith(sections.map(s => {
- return `
- <div class="dtpsFormattedAssignmentSection" style="margin: 20px 0px;">
- <h2><i style="vertical-align: middle; margin-right: 10px; font-size: 24px;" class="material-icons-outlined">${s.icon}</i><span style="vertical-align: middle;text-decoration: underline;">${s.text}</span></h2>
- ${s.innerHTML}
- </div>
- `;
- }).join(""));
- var outerHTML = tmpjQuery.html();
-
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet">
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};} .dtpsFormattedAssignmentSection *:not(a) { color: ${computedTextColor} !important; } .dtpsFormattedAssignmentSection * { background: none !important; }</style>
- ${outerHTML}
- `], { type: 'text/html' });
- assignmentBodyHTML = `<iframe id="assignmentParts" onload="dtps.iframeLoad('assignmentParts')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${window.URL.createObjectURL(blob)}" />`;
- } else {
- //Generate a blob with the assignment body and get its data URL
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};}</style>
- ${body}
- `], { type: 'text/html' });
- assignmentBodyHTML = `<iframe id="assignmentIframe" onload="dtps.iframeLoad('assignmentIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${window.URL.createObjectURL(blob)}" />`;
- }
- }
-
- //Get assignment rubric HTML
- var assignmentRubricHTML = "";
- if (assignment.rubric) {
- var assignmentRubricHTML = assignment.rubric.map(function (rubricItem) {
- return /*html*/`
- <div class="dtpsAssignmentRubricItem">
- <h5>${rubricItem.title}</h5>
- <div class="score">
- <p style="color: ${(!generic && rubricItem.color) ? rubricItem.color : "var(--secText)"};" class="scoreName">
- ${generic ? "" : (rubricItem.score !== undefined ? rubricItem.scoreName || "" : "Not assessed")}
-
- <div class="points">
- <p class="earned">${generic ? "" : rubricItem.score ?? "-"}</p>
- <p class="possible">${"/" + rubricItem.value}</p>
- </div>
- </p>
- </div>
- </div>
- `
- }).join("");
- }
-
- //Get assignment feedback HTML
- var assignmentFeedbackHTML = "";
- if (assignment.feedback) {
- var assignmentFeedbackHTML = assignment.feedback.map(feedback => {
- return /*html*/`
- <div class="dtpsSubmissionComment">
- ${feedback.author ? /*html*/`
- <img src="${feedback.author.photoURL}" />
- <h5>${feedback.author.name}</h5>
- ` : ``}
-
- <p>${feedback.comment}</p>
- </div>
- `
- }).join("");
- }
-
- //Get assignment score HTML
- var scoreHTML = dtps.renderAssignmentScore(assignment);
-
- //Render assignment details
- $(".card.details").html(/*html*/`
- <i onclick="fluid.cards.close('.card.details'); $('.card.details').html('');" class="material-icons close">close</i>
-
- <h4 style="font-weight: bold;">${assignment.title}</h4>
-
- <div>
- ${assignment.dueAt ? `<div class="assignmentChip"><i class="material-icons">alarm</i><span>Due ${dtps.formatDate(assignment.dueAt)}</span></div>` : ""}
- ${assignment.turnedIn && !generic ? `<div title="Assignment submitted" class="assignmentChip" style="color: #0bb75b"><i class="material-icons">assignment_turned_in</i></div>` : ""}
- ${assignment.missing && !generic ? `<div title="Assignment is missing" class="assignmentChip" style="color: #c44848"><i class="material-icons">remove_circle_outline</i></div>` : ""}
- ${assignment.late && !generic ? `<div title="Assignment is late" class="assignmentChip" style="color: #c44848"><i class="material-icons">assignment_late</i></div>` : ""}
- ${assignment.locked && !generic ? `<div title="Assignment submissions are locked" class="assignmentChip" style="color: var(--secText, gray);"><i class="material-icons">lock_outline</i></div>` : ""}
- ${(dtps.user.parent && !generic) ? `<div class="assignmentChip"><i class="material-icons">person</i><span>${dtps.user.children.find(c => c.id == dtps.classes[assignment.class].userID).name}</span></div>` : ""}
- ${generic ? "" : scoreHTML}
- </div>
-
- <div style="margin-top: 20px;" class="assignmentBody">
- ${assignment.body ? assignmentBodyHTML : ""}
- </div>
-
- ${assignment.body ? `<div style="margin: 5px 0px; background-color: var(--darker); height: 1px; width: 100%;" class="divider"></div>` : ""}
-
- <div style="width: calc(40% - 2px); margin-top: 20px; display: inline-block; overflow: hidden; vertical-align: top;">
- ${assignment.publishedAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">add_box</i> Published: ${dtps.formatDate(assignment.publishedAt)}</p>` : ""}
- ${assignment.dueAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">alarm</i> Due: ${dtps.formatDate(assignment.dueAt)}</p>` : ""}
- ${assignment.value ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">bar_chart</i> Point value: ${assignment.value}</p>` : ""}
- ${(assignment.grade || (assignment.grade == 0)) && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">assessment</i> Points earned: ${assignment.grade}</p>` : ""}
- ${assignment.letter && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">font_download</i> Letter grade: ${assignment.letter}</p>` : ""}
- ${assignment.category ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">category</i> Category: ${assignment.category}</p>` : ""}
- ${assignment.rubric ? assignment.rubric.map(function (rubricItem) { return `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">adjust</i> ${rubricItem.title}</p>`; }).join("") : ""}
- <p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">class</i> Class: ${dtps.classes[assignment.class].subject}</p>
- ${dtps.env == "dev" ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="material-icons">code</i> Assignment ID: ${assignment.id}</p>` : ""}
-
- <br />
- <div class="row">
- ${assignment.url ? `<button class="btn small outline" onclick="window.open('${assignment.url}')"><i class="material-icons">open_in_new</i> Open in ${dtpsLMS.shortName || dtpsLMS.name}</button>` : ``}
- </div>
- </div>
-
- <div style="width: calc(60% - 7px); margin-top: 20px; margin-left: 5px; display: inline-block; overflow: hidden; vertical-align: middle;">
- ${!generic ? assignmentFeedbackHTML : ""}
-
- ${assignmentRubricHTML}
- </div>
- `);
-
- //Close other active cards and open the assignment details card
- fluid.cards.close(".card.focus");
- fluid.cards(".card.details");
-}
-
-/**
- * Shows the module stream for a class
- *
- * @param {string} classID Class number to fetch modules for
- */
-dtps.moduleStream = function (classID) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(classID);
- dtps.selectedClass = classNum;
-
- //Set stream as the selected content
- dtps.selectedContent = "moduleStream";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.stream").addClass("active");
-
- //Save coursework stream preference
- window.localStorage.setItem("courseworkPref-" + classID, "moduleStream");
-
- //Load class color, name, etc.
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.moduleStream");
- }
-
- //Show loading indicator
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "moduleStream")) {
- jQuery(".classContent").html(dtps.renderStreamTools(classNum, "modules") + /*html*/`
- <div class="module card collapsed">
- <h4>
- <i class="material-icons collapseIcon shimmer">star</i>
- <span class="shimmer">[SHIMMER] Module title (collapsed)</span>
- </h4>
- <div class="moduleContents" style="padding-top: 10px;"></div>
- </div>
- <div class="module card">
- <h4>
- <i class="material-icons collapseIcon shimmer">star</i>
- <span class="shimmer">[SHIMMER] Module title</span>
- </h4>
-
- <div class="moduleContents" style="padding-top: 10px;">
- <div class="moduleItem shimmer">[SHMMER] module item</div>
- <div class="moduleItem shimmer">[SHMMER] module item</div>
- <div class="moduleItem shimmer">[SHMMER] module item</div>
- <div class="moduleItem shimmer">[SHMMER] module item</div>
- <div class="moduleItem shimmer">[SHMMER] module item</div>
- </div>
- </div>
- `);
- }
-
- new Promise(resolve => {
- if (dtps.classes[classNum].modules && (dtps.classes[classNum].modules !== true)) {
- resolve(dtps.classes[classNum].modules);
- } else {
- dtpsLMS.fetchModules(dtps.user.id, dtps.classes[classNum].lmsID).then(data => resolve(data));
- }
- }).then(data => {
- //Save modules data in the class object for future use
- dtps.classes[classNum].modules = data;
-
- var modulesHTML = dtps.renderStreamTools(classNum, "modules");
- var allCollapsed = true;
-
- data.forEach(module => {
- var moduleItemHTML = "";
- if (!module.collapsed) allCollapsed = false;
-
- //Get HTML for each module item
- module.items.forEach(item => {
- //Get module item icon
- var icon = "list";
- if (item.type == "assignment") icon = "assignment";
- if (item.type == "page") icon = "insert_drive_file";
- if (item.type == "discussion") icon = "forum";
- if (item.type == "url") icon = "open_in_new";
- if (item.type == "header") icon = "format_size";
- if (item.type == "embed") icon = "web";
-
- //Get module action
- var action = "";
- if (item.type == "assignment") action = "dtps.assignment('" + item.id + "', " + classNum + ")";
- if (item.type == "page") {
- action = "fluid.screen('pages', '" + classID + "|" + item.id + "|true')";
- }
- if (item.type == "discussion") {
- action = "fluid.screen('discussions', '" + classID + "|" + item.id + "|true')";
- }
- if (item.type == "url") action = "window.open('" + item.url + "')";
- if (item.type == "header") action = "";
- if (item.type == "embed") action = "dtps.showIFrameCard('" + item.url + "')";
-
- //Get module HTML
- if (item.type == "header") {
- moduleItemHTML += `<h5 style="font-size: 16px;padding: 0px 10px; text-decoration: underline;">${item.title}</h5>`;
- } else {
- moduleItemHTML += `
- <div class="moduleItem" onclick="${action}" style="margin-left: ${item.indent * 15}px;">
- <i ${item.completed ? `style="color: #27ba3c"` : ""} class="material-icons">${item.completed ? "check" : icon}</i>
- ${item.title}
- </div>
- `;
- }
- });
-
- //Add HTML for this module to the string
- modulesHTML += /*html*/`
- <div class="module card ${module.collapsed ? "collapsed" : ""}">
- <h4>
- <i onclick="dtps.moduleCollapse(this, '${dtps.classes[classNum].id}', '${module.id}');"
- class="material-icons collapseIcon">${module.collapsed ? "keyboard_arrow_right" : "keyboard_arrow_down"}</i>
- ${module.title}
- </h4>
-
- <div class="moduleContents" style="padding-top: 10px;">
- ${moduleItemHTML}
- </div>
- </div>
- `;
- });
-
- if (data.length == 0) {
- modulesHTML += /*html*/`
- <div style="text-align: center;">
- <div style="margin: 60px; padding: 20px 40px; display: inline-block; border: 2px solid var(--elements); border-radius: var(--elementRadius);">
- <h5>No Modules</h5>
- <p>There aren't any modules in this class yet.</p>
- </div>
- </div>
- `;
- }
-
- //Render module HTML
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "moduleStream")) {
- $(".classContent").html(modulesHTML);
- if (dtpsLMS.collapseAllModules) {
- $("#moduleExpandCollapse").html(allCollapsed ? `<i class="material-icons">unfold_more</i> Expand all` : `<i class="material-icons">unfold_less</i> Collapse all`);
- $("#moduleExpandCollapse").attr("onclick", allCollapsed ? `dtps.moduleCollapseAll(false)` : `dtps.moduleCollapseAll(true)`);
- $("#moduleExpandCollapse").show();
- }
- }
- }).catch(err => {
- dtps.error("Could not load modules", "Caught promise rejection @ dtps.moduleStream", err);
- });
-}
-
-/**
- * Collapses a module
- *
- * @param {Element} ele Element of the module collapse arrow
- * @param {string} classID Class ID
- * @param {string} modID Module ID of the module to collapse
- */
-dtps.moduleCollapse = function (ele, classID, modID) {
- //Add collapsed class to module card
- $(ele).parents('.card').toggleClass('collapsed');
-
- //Update arrow icon and, if the LMS supports it, collapse the module in the LMS as well
- if ($(ele).parents('.card').hasClass('collapsed')) {
- if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, true);
- $(ele).html('keyboard_arrow_right');
- dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = true;
- } else {
- if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, false);
- $(ele).html('keyboard_arrow_down');
- dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = false;
- }
-
-}
-
-
-/**
- * Collapses all module
- *
- * @param {boolean} collapse If true, modules will be collapsed, otherwise, they will all be expanded
- */
-dtps.moduleCollapseAll = function (collapse) {
- if (collapse && dtpsLMS.collapseAllModules) {
- dtpsLMS.collapseAllModules(dtps.classes[dtps.selectedClass].lmsID, true);
- $(".classContent .card.module h4 i").text("keyboard_arrow_right");
- $(".classContent .module.card").addClass("collapsed");
- dtps.classes[dtps.selectedClass].modules.forEach(m => m.collapsed = true);
- $("#moduleExpandCollapse").html(`<i class="material-icons">unfold_more</i> Expand all`);
- $("#moduleExpandCollapse").attr("onclick", `dtps.moduleCollapseAll(false)`);
- } else if (dtpsLMS.collapseAllModules) {
- dtpsLMS.collapseAllModules(dtps.classes[dtps.selectedClass].lmsID, false);
- $(".classContent .card.module h4 i").text("keyboard_arrow_down");
- $(".classContent .module.card").removeClass("collapsed");
- dtps.classes[dtps.selectedClass].modules.forEach(m => m.collapsed = false);
- $("#moduleExpandCollapse").html(`<i class="material-icons">unfold_less</i> Collapse all`);
- $("#moduleExpandCollapse").attr("onclick", `dtps.moduleCollapseAll(true)`);
- }
-}
-
-/**
- * Gets stream tools HTML (search box, class info, and modules/assignment switcher)
- *
- * @param {number} num Class number
- * @param {string} type Class content these tools are for (e.g. "stream")
- * @return {string} Stream tools HTML
- */
-dtps.renderStreamTools = function (num, type) {
- var modulesSelector = dtps.classes[num].modules;
- return /*html*/`
- ${(type == "modules") || (type == "stream") ? /*html*/`
- <div style="text-align: right;${modulesSelector ? "" : "margin-top: 20px;"}">
- ${modulesSelector ? /*html*/`
- ${(type == "modules") && dtpsLMS.collapseAllModules ? `<button id="moduleExpandCollapse" onclick="dtps.moduleCollapseAll()" style="margin-right:20px;display:none;" class="btn"></button>` : ""}
- <div class="btns row small acrylicMaterial assignmentPicker" style="margin: 5px 20px 5px 0px !important;">
- <button class="btn ${type == "stream" ? "active" : ""}" onclick="fluid.screen('stream', dtps.classes[dtps.selectedClass].id);"><i class="material-icons">assignment</i>Assignments</button>
- <button class="btn ${type == "modules" ? "active" : ""}" onclick="fluid.screen('moduleStream', dtps.classes[dtps.selectedClass].id);"><i class="material-icons">view_module</i>Modules</button>
- </div>
- ` : ``}
-
- </div>` : ``
- }
- `;
-}
-
-/**
- * Shows the generic gradebook
- *
- * @param {string} classID Class ID
- */
-dtps.gradebook = function (classID) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(classID);
- dtps.selectedClass = classNum;
-
- //Set stream as the selected content
- dtps.selectedContent = "grades";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.grades").addClass("active");
-
- //Load class color, name, etc.
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.gradebook");
- }
-
- //Show loading indicator
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
- }
-
- //Terminate function if the class doesn't have a letter grade or assignments
- if (!dtps.classes[classNum].letter || !dtps.classes[classNum].assignments) {
- return;
- }
-
- //Define variables for total points and zeros
- var zeros = 0;
- var totalPoints = 0;
- var earnedPoints = 0;
- var gradedAssignments = 0;
-
- //Define variable for assignment HTML string
- var assignmentHTML = "";
-
- //Calculate total points and zeros
- dtps.classes[classNum].assignments.forEach(assignment => {
- if (assignment.grade || (assignment.grade == 0)) {
- earnedPoints += assignment.grade;
- gradedAssignments++;
-
- assignmentHTML += /*html*/`
- <div onclick="dtps.assignment('${assignment.id}', ${classNum})" class="gradebookAssignment card">
- <h5>
- ${assignment.title}
-
- <div class="stats">
- ${assignment.letter ? `<div class="gradebookLetter">${assignment.letter}</div>` : ""}
- <div class="gradebookScore">${assignment.grade}</div>
- <div class="gradebookValue">/${assignment.value}</div>
- <div class="gradebookPercentage">${Math.round((assignment.grade / assignment.value) * 100)}%</div>
- </div>
- </h5>
- </div>
- `;
- }
-
- if (assignment.value) {
- totalPoints += assignment.value;
- }
-
- if ((assignment.grade == 0) && assignment.value) {
- zeros++;
- }
- })
-
- //Grade calculation summary
- var gradeCalcSummary = /*html*/`
- <div style="--classColor: ${dtps.classes[classNum].color}" class="card">
- <h3 class="gradeTitle">
- Grade Summary
- <div class="classGradeCircle">
- ${dtps.classes[classNum].grade ? `<span class="percentage">${dtps.classes[classNum].grade}%</span>` : ``}
- <div class="letter">${dtps.classes[classNum].letter || ``}</div>
- </div>
- </h3>
-
- ${zeros ? /*html*/`
- <h5 style="color: #d63d3d;" class="gradeStat">
- Zeros
- <div style="color: #d63d3d;" class="numFont">${zeros}</div>
- </h5>
- ` : ``}
-
- <div style="${dtps.gradebookExpanded ? "" : "display: none;"}" id="genericClassGradeMore">
- <br />
-
- ${dtps.classes[classNum].previousLetter ? /*html*/`
- <h5 class="smallStat">
- Previous Grade
- <div class="numFont">${dtps.classes[classNum].previousLetter}</div>
- </h5>
- ` : ``}
-
- <h5 class="smallStat">
- Points
- <div class="numFont fraction">
- <span class="earned">${earnedPoints}</span>
- <span class="total">/${totalPoints}</span>
- </div>
- </h5>
-
- <h5 class="smallStat">
- Graded Assignments
- <div class="numFont">${gradedAssignments}</div>
- </h5>
- </div>
-
- <br />
- <a onclick="$('#genericClassGradeMore').toggle(); if ($('#genericClassGradeMore').is(':visible')) {$(this).html('Show less'); dtps.gradebookExpanded = true;} else {$(this).html('Show more'); dtps.gradebookExpanded = false;}"
- style="color: var(--secText, gray); cursor: pointer; margin-right: 10px;">${dtps.gradebookExpanded ? "Show less" : "Show more"}</a>
- </div>
-
- <br />
- `;
-
-
- //Render HTML
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
- $(".classContent").html(gradeCalcSummary + assignmentHTML);
- }
-}
-
-//Fluid UI screen definitions
-fluid.externalScreens.dashboard = () => {
- dtps.mainStream();
-}
-
-fluid.externalScreens.stream = (courseID) => {
- dtps.classStream(courseID);
-}
-
-fluid.externalScreens.moduleStream = (courseID) => {
- dtps.moduleStream(courseID);
-}
-
-fluid.externalScreens.gradebook = (courseID) => {
- dtps.gradebook(courseID);
-}
-
-//Type definitions
-
-/**
-* @typedef {Object} Assignment
-* @description Defines assignments objects in DTPS
-* @property {string} title Title of the assignment
-* @property {string} [body] HTML of the assignment's body
-* @property {string} id Assignment ID
-* @property {number} class Automatically managed by DTPS. The class number that this assignment belongs to.
-* @property {Date} [dueAt] Assignment due date
-* @property {string} [url] Assignment URL
-* @property {AssignmentFeedback[]} [feedback] Feedback / private comments for this assignment
-* @property {User} [grader] Assignment grader
-* @property {boolean} [turnedIn] True if the assignment is turned in
-* @property {boolean} [late] True if the assignment is late
-* @property {boolean} [missing] True if the assignment is missing
-* @property {boolean} [locked] True if assignment submissions are locked
-* @property {string} [category] Assignment category
-* @property {Date} [publishedAt] Date for when the assignment was published
-* @property {Date} [gradedAt] Date for when the assignment was graded
-* @property {number} [grade] Points earned on this assignment
-* @property {string} [letter] Letter grade on this assignment
-* @property {number} [value] Total amount of points possible for this assignment
-* @property {RubricItem[]} [rubric] Assignment rubric
-*/
-
-/**
-* @typedef {Object} Module
-* @description Defines module objects in DTPS
-* @property {string} title Title of the module
-* @property {string} id Module ID
-* @property {boolean} [collapsed] True if the module is collapsed, false otherwise. undefined or null if this module does not support collapsing.
-* @property {ModuleItem[]} items An array of items for this module.
-*/
-
-/**
- * @typedef {Object} ModuleItem
- * @description Defines module items in DTPS
- * @property {string} type Either "assignment", "page", "discussion", "url", "embed", or "header".
- * @property {string} [title] Required for URL and header items, and can be used to override the title of assignment, page, and discussion items.
- * @property {string} [id] Required for assignment, page, and discussion items.
- * @property {string} [url] Required for URL and embed items. Required for discussion and page items if the class does not support the pages or discussions feature.
- * @property {number} [indent] Indent level
- * @property {boolean} [completed] True if the module item has been completed
- */
-
-/**
-* @typedef {Object} Announcement
-* @description Defines announcement objects in DTPS
-* @property {string} title Title of the announcement
-* @property {Date} postedAt Date when the announcement was posted
-* @property {string} body Announcement content
-* @property {string} url Announcement URL
-*/
-
-/**
-* @typedef {Object} AssignmentFeedback
-* @description Defines assignment feedback objects in DTPS
-* @property {string} comment Feedback comment
-* @property {User} [author] Feedback author
-*/
-
-/**
-* @typedef {Object} RubricItem
-* @description Defines rubric item objects in DTPS
-* @property {string} title Title of the rubric item
-* @property {string} id Rubric item ID (only needs to be unique to this assignment)
-* @property {number} value Total amount of points possible
-* @property {string} [outcome] The ID of the outcome this rubric item is assessing. This is only used for grade calculation.
-* @property {string} [description] Rubric item description
-* @property {number} [score] Rubric assessment score in points
-* @property {string} [scoreName] Rubric assessment score name
-* @property {string} [color] Score color in a CSS color format
-*/
-
-/**
- * @typedef {Object} DashboardItem
- * @description Defines dashboard items in DTPS
- * @property {string} name Dashbord item name
- * @property {string} id Unique dashboard item ID
- * @property {string} icon Dashboard item icon
- * @property {boolean} supportsCompactMode True if this dashboard item supports compact mode
- * @property {number} size The approximate size of this dashboard item relative to other dashboard items. Should be no less than 20.
- * @property {string} defaultSide The default side of this dashboard item. Either "right" or "left".
- * @property {boolean} compact True if the user has turned on compact mode for this item.
+/**
+ * @file DTPS assignment functions
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+/**
+ * Renders HTML for an assignment item in a list
+ *
+ * @param {Assignment} assignment The assignment object to render
+ * @param {string} [childDisplay] Text to display for specifying the child or children this assignment is for
+ * @return {string} Assignment HTML for use in a list
+ */
+dtps.renderAssignment = function (assignment, childDisplay) {
+ //Render points/letter score
+ var scoreHTML = dtps.renderAssignmentScore(assignment);
+
+ var HTML = /*html*/`
+ <div
+ onclick="${`dtps.assignment('` + assignment.id + `', ` + assignment.class + `, ` + (!isNaN(childDisplay) ? true : false) + `)`}"
+ class="card ${scoreHTML ? "graded assignment" : "assignment"}"
+ style="${'--classColor: ' + dtps.classes[assignment.class].color}"
+ >
+
+ <!-- Color bar for the dashboard -->
+ <div class="colorBar"></div>
+
+ <!-- Assignment title and points -->
+ <h4>
+ <span>${assignment.title}</span>
+
+ <!-- Points display -->
+ ${scoreHTML ? `<div class="points">${scoreHTML}</div>` : ``}
+ </h4>
+
+ <h5>
+ <!-- Assignment info -->
+ <div class="info">
+ ${assignment.dueAt ? `<div ${dtpsLMS.isUsualDueDate && !dtpsLMS.isUsualDueDate(assignment.dueAt) ? `style="font-weight: bold;color: var(--text);"` : ""} class="infoChip"><i style="margin-top: -2px;" class="fluid-icon">alarm</i> Due ` + dtps.formatDate(assignment.dueAt) + `</div>` : ""}
+ ${assignment.outcomes ? `<div class="infoChip weighted"><i class="fluid-icon">adjust</i>` + assignment.outcomes.length + `</div>` : ""}
+ ${assignment.category ? `<div class="infoChip weighted"><i class="fluid-icon">category</i> ` + assignment.category + `</div>` : ""}
+ ${childDisplay ? `<div class="infoChip weighted"><i class="fluid-icon">person</i> ` + childDisplay + `</div>` : ""}
+ </div>
+
+ <!-- Status icons -->
+ <div class="status">
+ ${assignment.turnedIn ? `<i title="Assignment submitted" class="fluid-icon statusIcon" style="color: #0bb75b;">assignment_turned_in</i>` : ``}
+ ${assignment.missing ? `<i title="Assignment is missing" class="fluid-icon statusIcon" style="color: #c44848;">remove_circle_outline</i>` : ``}
+ ${assignment.late ? `<i title="Assignment is late" class="fluid-icon statusIcon" style="color: #c44848;">assignment_late</i>` : ``}
+ ${assignment.locked ? `<i title="Assignment submissions are locked" class="fluid-icon statusIcon" style="color: var(--secText, gray);">lock_outline</i>` : ``}
+ ${assignment.pending ? `<i title="Grade is pending review" class="fluid-icon statusIcon" style="color: #b3b70b;">rate_review</i>` : ``}
+ </div>
+ </h5>
+ </div>
+ `;
+
+ return HTML;
+}
+
+/**
+* Renders HTML for an assignment score if the assignment is graded
+*
+* @param {Assignment} assignment The assignment object to render a score for
+* @return {string} Assignment score HTML
+*/
+dtps.renderAssignmentScore = function (assignment) {
+ var scoreHTML = "";
+
+ //Use rubric score over points score if possible
+ if (dtpsLMS.useRubricGrades && assignment.rubric) {
+ var rubricHTML = [];
+
+ assignment.rubric.forEach(rubricItem => {
+ if (rubricItem.score !== undefined) {
+ rubricHTML.push(/*html*/`
+ <div title="${rubricItem.title}" style="color: ${rubricItem.color || "var(--text)"};">
+ ${rubricItem.score}
+ </div>
+ `);
+ }
+ });
+
+ if (rubricHTML.length) scoreHTML = `<div class="dtpsRubricScore">${rubricHTML.join("")}</div>`;
+
+ } else if (!dtpsLMS.useRubricGrades && (assignment.grade || (assignment.grade == 0))) {
+ scoreHTML = /*html*/`
+ <div class="assignmentGrade">
+ <div class="grade">${Number(assignment.grade.toFixed(2))}</div>
+ <div class="value">/${Number(assignment.value.toFixed(2))}</div>
+ ${assignment.letter ? `<div class="letter">${assignment.letter.replace("incomplete", `<i class="fluid-icon">cancel</i>`).replace("complete", `<i class="fluid-icon">done</i>`)}</div>` : ""}
+ <div class="percentage">${Math.round((assignment.grade / assignment.value) * 100)}%</div>
+ </div>
+ `;
+ }
+
+ return scoreHTML;
+}
+
+/**
+* Merges and renders assignments for children in the same class
+*
+* @param {Assignment[]} assignments An array of assignment objects to merge
+* @return {string} HTML with the assignments merged and labelled
+*/
+dtps.mergeAndRenderChildAssignments = function (assignments) {
+ var assignmentGroups = [];
+
+ assignments.forEach(assignment => {
+ var matchedGroup = false;
+ assignmentGroups.forEach(group => {
+ var groupAssignment = group[0];
+
+ //Check if assignment matches group assignment
+ var matchKeys = ["id", "dueAt", "locked", "category", "turnedIn", "late", "missing", "grade", "value", "letter"];
+ var matches = 0;
+ matchKeys.forEach(k => {
+ if (assignment[k] == groupAssignment[k]) matches++;
+ });
+
+ if (matches == matchKeys.length) {
+ matchedGroup = true;
+ group.push(assignment);
+ }
+ });
+
+ if (!matchedGroup) {
+ assignmentGroups.push([assignment]);
+ }
+ });
+
+ return assignmentGroups.map(g => {
+ return dtps.renderAssignment(g[0], g.length == 1 ? dtps.user.children.find(c => c.id == dtps.classes[g[0].class].userID).name : g.length);
+ }).join("");
+}
+
+/**
+ * Renders the DTPS dashboard and calls dtps.renderCalendar, dtps.renderUpdates, and dtps.renderUpcoming
+ */
+dtps.mainStream = function () {
+ //Ensure classes are rendered in the sidebar
+ dtps.presentClass("dash");
+ dtps.showClasses();
+
+ //Clear active state from all tabs
+ $("#dtpsTabBar .btn").removeClass("active");
+
+ //Count amount of classes that are loaded
+ var ready = 0;
+ dtps.classes.forEach(course => {
+ if (course.assignments) ready++;
+ });
+
+ //Check if all classes are loaded
+ var doneLoading = ready == dtps.classes.length;
+
+ //Returns dashboard item container HTML for an item
+ function dashboardContainerHTML(dashboardItem) {
+ if (dashboardItem.id == "dtps.calendar") {
+ return window.FullCalendar ? `<div id="calendar" class="card" style="padding: 20px;"></div>` : "";
+ } else if (dashboardItem.id == "dtps.updates") {
+ return `<div class="updatesStream recentlyGraded announcements"></div>`;
+ } else if (dashboardItem.id == "dtps.dueToday") {
+ return `<div style="padding: 20px 0px;" class="dueToday"></div>`;
+ } else if (dashboardItem.id == "dtps.upcoming") {
+ return `<div style="padding: 20px 0px;" class="assignmentStream"></div>`;
+ }
+ }
+
+ //Render HTML with loading placeholder
+ if (dtps.selectedClass == "dash") {
+ jQuery(".classContent").html(/*html*/`
+ <div style="letter-spacing: 0px;">
+ <div style="float: left; width: 45%; display: inline-block;" class="dash">
+ ${dtps.leftDashboard.map(dashboardItem => {
+ return dashboardContainerHTML(dashboardItem);
+ }).join("")}
+ </div>
+
+ <div style="float: left; width: 55%; display: inline-block;" class="dash">
+ ${!doneLoading ? `<div style="margin: 75px 25px 10px 75px;"><div class="spinner"></div></div>` : ""}
+ ${dtps.rightDashboard.map(dashboardItem => {
+ return dashboardContainerHTML(dashboardItem);
+ }).join("")}
+ </div>
+ </div>
+ `);
+ }
+
+ //Render updates stream
+ dtps.renderUpdates();
+
+ //Render upcoming assignments stream
+ dtps.renderUpcoming();
+
+ //Render calendar
+ dtps.calendar(doneLoading);
+
+ //Render due today
+ dtps.renderDueToday(doneLoading);
+}
+
+/**
+ * Checks if a due date is on a date
+ *
+ * @param {Date} date Date to check
+ * @param {Date} [onDate] Date checked against (defaults to today)
+ */
+dtps.isDueOnDate = function (date, onDate) {
+ var today = onDate ? new Date(onDate) : new Date();
+ var tomorrow = new Date(today.getTime() + 86400000);
+ var d1 = new Date(date);
+
+ var isActuallyTodayAfter9 = d1.getFullYear() === today.getFullYear() &&
+ d1.getMonth() === today.getMonth() &&
+ d1.getDate() === today.getDate() &&
+ d1.getHours() >= 9;
+
+ var isTomorrowBefore9 = d1.getFullYear() === tomorrow.getFullYear() &&
+ d1.getMonth() === tomorrow.getMonth() &&
+ d1.getDate() === tomorrow.getDate() &&
+ d1.getHours() < 9;
+
+ return isActuallyTodayAfter9 || isTomorrowBefore9;
+}
+
+/**
+ * Compiles and displays due today / to-do stream
+ *
+ * @param {boolean} doneLoading True if all classes have finished loading their assignment lists
+ * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
+ */
+dtps.renderDueToday = function (doneLoading, fromDate) {
+ //Combine class stream arrays
+ var combinedStream = [];
+ if (dtps.classes) {
+ dtps.classes.forEach(course => {
+ if (course.assignments) {
+ //If course has assignments, add them to the combined stream array
+ course.assignments.forEach(assignment => {
+ //Only assignments that are due today
+ if (dtps.isDueOnDate(assignment.dueAt, fromDate)) {
+ combinedStream.push(assignment);
+ }
+ })
+ }
+ })
+ }
+
+ //Sort combined stream by date
+ combinedStream.sort(function (a, b) {
+ var keyA = new Date(a.dueAt).getTime(),
+ keyB = new Date(b.dueAt).getTime();
+
+ // Compare the 2 dates
+ if (keyA > keyB) return 1;
+ if (keyA < keyB) return -1;
+ return 0;
+ });
+
+ //Get due today stream HTML
+ if (dtps.user.parent) {
+ var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
+ } else {
+ var combinedHTML = combinedStream.map(assignment => {
+ return dtps.renderAssignment(assignment);
+ }).join("");
+ }
+
+ if (combinedStream.length == 0) {
+ //Nothing due today
+ if (doneLoading) {
+ combinedHTML = `<p style="text-align: center;margin: 10px 0px; font-size: 18px;"><i class="fluid-icon">done</i> ${fromDate ? "Nothing is due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Nothing is due today"}</p>`;
+ } else {
+ combinedHTML = ``;
+ }
+ } else {
+ //Add header
+ combinedHTML = /*html*/`
+ <h5 style="text-align: center; margin: 10px 0px; font-weight: bold;">${fromDate ? "Due on " + fromDate.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }) : "Due Today"}</h5>
+ ` + combinedHTML;
+ }
+
+ if (dtps.selectedClass == "dash") {
+ jQuery(".classContent .dash .dueToday").html(combinedHTML);
+ }
+}
+
+/**
+ * Compiles and displays upcoming assignments stream
+ *
+ * @param {Date} [fromDate] The date to display assignments from. Defaults to the current date.
+ */
+dtps.renderUpcoming = function (fromDate) {
+ //Combine class stream arrays
+ var today = fromDate ? new Date(fromDate) : new Date();
+ var combinedStream = [];
+ if (dtps.classes) {
+ dtps.classes.forEach(course => {
+ if (course.assignments) {
+ //If course has assignments, add them to the combined stream array
+ course.assignments.forEach(assignment => {
+ //Only include upcoming assignments that aren't due today
+ if ((new Date(assignment.dueAt).getTime() > today.getTime()) && !dtps.isDueOnDate(assignment.dueAt, today)) {
+ combinedStream.push(assignment);
+ }
+ })
+ }
+ })
+ }
+
+ //Sort combined stream by date
+ combinedStream.sort(function (a, b) {
+ var keyA = new Date(a.dueAt).getTime(),
+ keyB = new Date(b.dueAt).getTime();
+
+ // Compare the 2 dates
+ if (keyA > keyB) return 1;
+ if (keyA < keyB) return -1;
+ return 0;
+ });
+
+ //Limit stream length to 30 assignments
+ if (combinedStream.length > 30) {
+ combinedStream.length = 30;
+ }
+
+ //Render upcoming assignments stream
+ if (dtps.user.parent) {
+ var combinedHTML = dtps.mergeAndRenderChildAssignments(combinedStream);
+ } else {
+ var combinedHTML = combinedStream.map(assignment => {
+ return dtps.renderAssignment(assignment);
+ }).join("");
+ }
+
+ //No upcoming assignments
+ if (combinedStream.length == 0) {
+ combinedHTML = "";
+ }
+
+ if (dtps.selectedClass == "dash") {
+ jQuery(".classContent .dash .assignmentStream").html(combinedHTML);
+ }
+}
+
+/**
+ * Renders updates stream (recently graded & announcements)
+ *
+ * @param {boolean} [dateSelected] True if a date is selected in the dashboard
+ */
+dtps.renderUpdates = function (dateSelected) {
+ //Get updates HTML
+ var updatesHTML = "";
+
+ if (dtps.remoteConfig.remoteUpdate.active) {
+ markdown = new showdown.Converter();
+ updatesHTML += /*html*/`
+ <div style="cursor: auto; padding: 20px; --classColor: var(--secText);" class="announcement card open">
+ <div class="className">
+ <img src="${dtps.baseURL + "/icon.svg"}" style="vertical-align: middle;width: 22px;margin-right: 5px;" />
+ <span style="font-weight: bold; vertical-align: middle; color: var(--text); font-size: 18px;">${dtps.remoteConfig.remoteUpdate.title}</span>
+ </div>
+ ${markdown.makeHtml(dtps.remoteConfig.remoteUpdate.md)}
+ </div>
+ `;
+ }
+
+ if (dateSelected && (dtps.selectedClass == "dash")) {
+ return jQuery(".classContent .dash .updatesStream").html(/*html*/`
+ <div style="cursor: auto; padding: 20px; --classColor: var(--secText);" class="announcement card open">
+ <div class="className">Date Selected</div>
+ <p>Updates are not shown while a date is selected</p>
+ </div>
+ `);
+ }
+
+ dtps.updates.forEach(update => {
+ if (update.type == "announcement") {
+ updatesHTML += /*html*/`
+ <div onclick="$(this).toggleClass('open');" style="cursor: pointer; padding: 20px; --classColor: ${dtps.classes[update.class].color};" class="announcement card">
+ <div class="className">${update.title}</div>
+ ${update.body}
+ </div>
+ `;
+ } else if (update.type == "assignment") {
+ var scoreHTML = dtps.renderAssignmentScore(update);
+ updatesHTML += /*html*/`
+ <div onclick="dtps.assignment('${update.id}', ${update.class})" style="--classColor: ${dtps.classes[update.class].color};" class="card recentGrade">
+ <h5>
+ <span>${update.title}</span>
+
+ <!-- Points display -->
+ ${scoreHTML ? `<div class="points">${scoreHTML}</div>` : ``}
+ </h5>
+
+ <p>${dtps.user.parent ? "Graded for " + dtps.user.children.find(c => c.id == dtps.classes[update.class].userID).name : "Graded"} at ${dtps.formatDate(update.gradedAt)}</p>
+ </div>
+ `;
+ }
+ })
+
+ if (dtps.selectedClass == "dash") {
+ jQuery(".classContent .dash .updatesStream").html(updatesHTML);
+ }
+}
+
+
+/**
+ * Compiles and displays the assignment calendar
+ *
+ * @param {boolean} doneLoading True if all classes have finished loading their assignment lists
+ */
+dtps.calendar = function (doneLoading) {
+ if (dtps.selectedClass == "dash") {
+ //Calendar events array
+ var calEvents = [];
+
+ //Add assignments from every class to calEvents array
+ dtps.classes.forEach((course, courseIndex) => {
+ if (course.assignments) {
+ //Class has assignments
+ course.assignments.forEach(assignment => {
+ //Show assignments due before 9AM on the previous day
+ var date = new Date(assignment.dueAt);
+ if (date.getHours() < 9) {
+ //Set the date to 23:59 the previous day for calendar display
+ date.setTime(date.getTime() - 86400000);
+ date.setHours(23);
+ date.setMinutes(59);
+ }
+
+ var existingEvent = calEvents.find(e => e.id == assignment.id);
+ if (existingEvent && assignment.missing) {
+ //Mark existing event as missing and link to missing assignment
+ existingEvent.missing = true;
+ existingEvent.borderColor = "#c44848";
+ existingEvent.assignmentID = assignment.id;
+ existingEvent.classNum = courseIndex;
+ } else if (!existingEvent) {
+ calEvents.push({
+ title: assignment.title,
+ start: date,
+ id: assignment.id,
+ allDay: true,
+ backgroundColor: course.color,
+ borderColor: (assignment.missing === true) ? '#c44848' : 'transparent',
+ textColor: "white",
+ classNum: courseIndex,
+ assignmentID: assignment.id,
+ missing: assignment.missing
+ });
+ }
+ });
+ }
+ });
+
+ //Render calendar
+ if (window.FullCalendar) {
+ var calendarEl = document.getElementById('calendar');
+ calendar = new FullCalendar.Calendar(calendarEl, {
+ locale: "en",
+ initialView: 'dayGridMonth',
+ events: calEvents,
+ eventContent: info => {
+ const { missing } = info.event.extendedProps;
+ const html = /*html*/`
+ <div class='fc-event-main-frame'>
+ <div class='fc-event-title-container'>
+ <div class='fc-event-title fc-sticky'>
+ ${missing ? `<i title="Assignment is missing" class="fluid-icon statusIcon">remove_circle_outline</i>` : ``}
+ <span style="vertical-align: middle;">${info.event.title}</span>
+ </div>
+ </div>
+ </div>
+ `;
+ return { html };
+ },
+ contentHeight: 0,
+ handleWindowResize: false,
+ headerToolbar: {
+ start: 'title',
+ center: '',
+ end: 'prev,next'
+ },
+ dateClick: function (info) {
+ if ($(info.dayEl).hasClass("fc-day-today")) return fluid.screen();
+
+ //Update calendar
+ $("#calendar .fc-daygrid-day").removeClass("active");
+ $(info.dayEl).addClass("active");
+ $("#calendar").addClass("dateSelected");
+
+ //Display selected date
+ $(".headerArea .contentLabel i").text("event");
+ $(".headerArea .contentLabel span").text("Showing assignments from " + info.date.toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric' }));
+ $(".headerArea .contentLabel").show();
+
+ //Re-render dashboard from the selected date
+ dtps.renderDueToday(doneLoading, info.date);
+ dtps.renderUpcoming(info.date);
+ dtps.renderUpdates(true);
+ },
+ eventClick: function (info) {
+ dtps.assignment(info.event.extendedProps.assignmentID, info.event.extendedProps.classNum);
+ }
+ });
+ calendar.render();
+ }
+ }
+}
+
+/**
+ * Shows the assignments stream for a class
+ *
+ * @param {string} classID The class ID to show assignments for
+ * @param {Assignment[]} [searchResults] An array of assignemnts to render instead of course.assignments. Used for assignment search.
+ */
+dtps.classStream = function (classID, searchResults) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(classID);
+ dtps.selectedClass = classNum;
+
+ //Set stream as the selected content
+ dtps.selectedContent = "stream";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.stream").addClass("active");
+
+ //Save coursework stream preference
+ window.localStorage.setItem("courseworkPref-" + classID, "stream");
+
+ //Load class color, name, etc.
+ dtps.presentClass(classNum);
+
+ //Ensure classes are shown in the sidebar
+ dtps.showClasses();
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.classStream");
+ }
+
+ //Use search results to render or render all class assignments
+ var assignments = searchResults || dtps.classes[classNum].assignments;
+
+ //Render assignments
+ if (!assignments) {
+ //Assignments are still loading
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
+ jQuery(".classContent").html(dtps.renderStreamTools(classNum, "stream") + [1, 2, 3, 4].map(() => (
+ /*html*/`
+ <div class="card assignment graded">
+ <h4>
+ <span style="width: 450px;" class="shimmer">Assignment Title</span>
+ <div class="points shimmer">00/00</div>
+ </h4>
+
+ <h5 style="white-space: nowrap; overflow: hidden;">
+ <div style="width: 200px;" class="infoChip shimmer"></div>
+ <i class="fluid-icon statusIcon shimmer">more_horiz</i>
+ </h5>
+ </div>
+ `
+ )).join(""));
+ }
+ } else if (assignments.length == 0) {
+ //This class doesn't have any assignments
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
+ $(".classContent").html(dtps.renderStreamTools(classNum, "stream") + /*html*/`
+ <div style="text-align: center;">
+ <div style="margin: 60px; padding: 20px 40px; display: inline-block; border: 2px solid var(--elements); border-radius: var(--elementRadius);">
+ <h5>No Assignments</h5>
+ <p>There aren't any assignments in this class yet.</p>
+ </div>
+ </div>
+ `);
+ }
+ } else {
+ //Sort assignments
+ assignments.sort(function (a, b) {
+ var keyA = new Date(a.dueAt).getTime(),
+ keyB = new Date(b.dueAt).getTime();
+
+ var now = new Date().getTime();
+
+ //Put assignments without a due date at the end
+ if (!a.dueAt) { keyA = 0; }
+ if (!b.dueAt) { keyB = 0; }
+
+ //Put upcoming assignments at the top
+ if ((keyA < now) || (keyB < now)) {
+ // Sort upcoming assignments from earliest -> latest
+ if (keyA < keyB) return 1;
+ if (keyA > keyB) return -1;
+ return 0;
+ } else {
+ // Sort old assignments from latest -> earliest
+ if (keyA > keyB) return 1;
+ if (keyA < keyB) return -1;
+ return 0;
+ }
+ });
+
+ //Render assignments
+ var prevAssignment = null;
+ var streamHTML = assignments.map(assignment => {
+ var divider = "";
+
+ if (!assignment.dueAt) {
+ if (prevAssignment && (prevAssignment !== "undated")) {
+ divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Undated Assignments</h5>`;
+ }
+
+ prevAssignment = "undated";
+ } else if (new Date(assignment.dueAt) < new Date()) {
+ if (prevAssignment && (prevAssignment !== "old")) {
+ divider = `<h5 style="margin: 75px 20px 10px 20px;font-weight: bold;">Old Assignments</h5>`;
+ }
+
+ prevAssignment = "old";
+ } else {
+ prevAssignment = "upcoming";
+ }
+
+ return divider + dtps.renderAssignment(assignment);
+ }).join("");
+
+ //Add stream header with class info buttons and search box
+ streamHTML = dtps.renderStreamTools(classNum, "stream") + streamHTML;
+
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "stream")) {
+ $(".classContent").html(streamHTML);
+ }
+ }
+}
+
+/**
+ * Shows details for an assignment given the assignment ID and class number
+ *
+ * @param {string} id Assignment ID
+ * @param {number} classNum Assignment class number
+ * @param {boolean} [generic] True if user-specific details, such as grades, should not be displayed
+ */
+dtps.assignment = function (id, classNum, generic) {
+ //Get assignment from the id prop
+ var assignmentIDs = dtps.classes[classNum].assignments.map(assignment => assignment.id);
+ var assignment = dtps.classes[classNum].assignments[assignmentIDs.indexOf(id)];
+
+ //The assignment body is rendered in an iFrame to keep its content and styling isolated from the rest of the page
+ var assignmentBodyHTML = null;
+ if (assignment.body) {
+ //Get computed background and text color to style the iFrame with
+ var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+ var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
+
+ var body = assignment.body;
+ if ($("body").hasClass("dark")) {
+ body = dtps.brightenTextForDarkMode(assignment.body, computedBackgroundColor);
+ }
+
+ var hasKeywords = false;
+ if (body.toLowerCase().includes("deliverable") && body.toLowerCase().includes("instruction") && body.toLowerCase().includes("look for")) hasKeywords = true;
+ if ((fluid.get('pref-formatAssignmentContent') !== "false") && dtpsLMS.dtech && hasKeywords && ($('<div></div>').append(body).children("table").find("tbody tr").length > 1)) {
+ var sections = [];
+ $('<div></div>').append(body).children("table").find("tbody tr").toArray().forEach((element, i) => {
+ var text = $(element).find("h4:first-child").text().toLowerCase();
+ if (!text) return;
+
+ var tmpjQuery = $(element);
+ tmpjQuery.find("h4:first-child").remove();
+ var innerHTML = tmpjQuery.html();
+ if (!innerHTML) return;
+
+ var icon = null;
+ if (text.includes("deliverable")) { icon = "description"; text = "Deliverables"; }
+ if (text.includes("instruction")) { icon = "assignment"; text = "Instructions"; }
+ if (text.includes("look for")) { icon = "find_in_page"; text = "Look Fors"; }
+
+ sections.push({ text, icon, innerHTML });
+ });
+
+ var tmpjQuery = $('<div></div>').append(body);
+ tmpjQuery.children("table").replaceWith(sections.map(s => {
+ return `
+ <div class="dtpsFormattedAssignmentSection" style="margin: 20px 0px;">
+ <h2><i style="vertical-align: middle; margin-right: 10px; font-size: 24px;" class="fluid-icon-outlined">${s.icon}</i><span style="vertical-align: middle;text-decoration: underline;">${s.text}</span></h2>
+ ${s.innerHTML}
+ </div>
+ `;
+ }).join(""));
+ var outerHTML = tmpjQuery.html();
+
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet">
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};} .dtpsFormattedAssignmentSection *:not(a) { color: ${computedTextColor} !important; } .dtpsFormattedAssignmentSection * { background: none !important; }</style>
+ ${outerHTML}
+ `], { type: 'text/html' });
+ assignmentBodyHTML = `<iframe id="assignmentParts" onload="dtps.iframeLoad('assignmentParts')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${window.URL.createObjectURL(blob)}" />`;
+ } else {
+ //Generate a blob with the assignment body and get its data URL
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};}</style>
+ ${body}
+ `], { type: 'text/html' });
+ assignmentBodyHTML = `<iframe id="assignmentIframe" onload="dtps.iframeLoad('assignmentIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${window.URL.createObjectURL(blob)}" />`;
+ }
+ }
+
+ //Get assignment rubric HTML
+ var assignmentRubricHTML = "";
+ if (assignment.rubric) {
+ var assignmentRubricHTML = assignment.rubric.map(function (rubricItem) {
+ return /*html*/`
+ <div class="dtpsAssignmentRubricItem">
+ <h5>${rubricItem.title}</h5>
+ <div class="score">
+ <p style="color: ${(!generic && rubricItem.color) ? rubricItem.color : "var(--secText)"};" class="scoreName">
+ ${generic ? "" : (rubricItem.score !== undefined ? rubricItem.scoreName || "" : "Not assessed")}
+
+ <div class="points">
+ <p class="earned">${generic ? "" : rubricItem.score ?? "-"}</p>
+ <p class="possible">${"/" + rubricItem.value}</p>
+ </div>
+ </p>
+ </div>
+ </div>
+ `
+ }).join("");
+ }
+
+ //Get assignment feedback HTML
+ var assignmentFeedbackHTML = "";
+ if (assignment.feedback) {
+ var assignmentFeedbackHTML = assignment.feedback.map(feedback => {
+ return /*html*/`
+ <div class="dtpsSubmissionComment">
+ ${feedback.author ? /*html*/`
+ <img src="${feedback.author.photoURL}" />
+ <h5>${feedback.author.name}</h5>
+ ` : ``}
+
+ <p>${feedback.comment}</p>
+ </div>
+ `
+ }).join("");
+ }
+
+ //Get assignment score HTML
+ var scoreHTML = dtps.renderAssignmentScore(assignment);
+
+ //Render assignment details
+ $(".card.details").html(/*html*/`
+ <i onclick="fluid.cards.close('.card.details'); $('.card.details').html('');" class="fluid-icon close">close</i>
+
+ <h4 style="font-weight: bold;">${assignment.title}</h4>
+
+ <div>
+ ${assignment.dueAt ? `<div class="assignmentChip"><i class="fluid-icon">alarm</i><span>Due ${dtps.formatDate(assignment.dueAt)}</span></div>` : ""}
+ ${assignment.turnedIn && !generic ? `<div title="Assignment submitted" class="assignmentChip" style="color: #0bb75b"><i class="fluid-icon">assignment_turned_in</i></div>` : ""}
+ ${assignment.missing && !generic ? `<div title="Assignment is missing" class="assignmentChip" style="color: #c44848"><i class="fluid-icon">remove_circle_outline</i></div>` : ""}
+ ${assignment.late && !generic ? `<div title="Assignment is late" class="assignmentChip" style="color: #c44848"><i class="fluid-icon">assignment_late</i></div>` : ""}
+ ${assignment.locked && !generic ? `<div title="Assignment submissions are locked" class="assignmentChip" style="color: var(--secText, gray);"><i class="fluid-icon">lock_outline</i></div>` : ""}
+ ${(dtps.user.parent && !generic) ? `<div class="assignmentChip"><i class="fluid-icon">person</i><span>${dtps.user.children.find(c => c.id == dtps.classes[assignment.class].userID).name}</span></div>` : ""}
+ ${generic ? "" : scoreHTML}
+ </div>
+
+ <div style="margin-top: 20px;" class="assignmentBody">
+ ${assignment.body ? assignmentBodyHTML : ""}
+ </div>
+
+ ${assignment.body ? `<div style="margin: 5px 0px; background-color: var(--darker); height: 1px; width: 100%;" class="divider"></div>` : ""}
+
+ <div style="width: calc(40% - 2px); margin-top: 20px; display: inline-block; overflow: hidden; vertical-align: top;">
+ ${assignment.publishedAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">add_box</i> Published: ${dtps.formatDate(assignment.publishedAt)}</p>` : ""}
+ ${assignment.dueAt ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">alarm</i> Due: ${dtps.formatDate(assignment.dueAt)}</p>` : ""}
+ ${assignment.value ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">bar_chart</i> Point value: ${assignment.value}</p>` : ""}
+ ${(assignment.grade || (assignment.grade == 0)) && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">assessment</i> Points earned: ${assignment.grade}</p>` : ""}
+ ${assignment.letter && !generic ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">font_download</i> Letter grade: ${assignment.letter}</p>` : ""}
+ ${assignment.category ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">category</i> Category: ${assignment.category}</p>` : ""}
+ ${assignment.rubric ? assignment.rubric.map(function (rubricItem) { return `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">adjust</i> ${rubricItem.title}</p>`; }).join("") : ""}
+ <p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">class</i> Class: ${dtps.classes[assignment.class].subject}</p>
+ ${dtps.env == "dev" ? `<p style="color: var(--secText); margin: 5px 0px;"><i style="vertical-align: middle;" class="fluid-icon">code</i> Assignment ID: ${assignment.id}</p>` : ""}
+
+ <br />
+ <div class="row">
+ ${assignment.url ? `<button class="btn small outline" onclick="window.open('${assignment.url}')"><i class="fluid-icon">open_in_new</i> Open in ${dtpsLMS.shortName || dtpsLMS.name}</button>` : ``}
+ </div>
+ </div>
+
+ <div style="width: calc(60% - 7px); margin-top: 20px; margin-left: 5px; display: inline-block; overflow: hidden; vertical-align: middle;">
+ ${!generic ? assignmentFeedbackHTML : ""}
+
+ ${assignmentRubricHTML}
+ </div>
+ `);
+
+ //Close other active cards and open the assignment details card
+ fluid.cards.close(".card.focus");
+ fluid.cards(".card.details");
+}
+
+/**
+ * Shows the module stream for a class
+ *
+ * @param {string} classID Class number to fetch modules for
+ */
+dtps.moduleStream = function (classID) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(classID);
+ dtps.selectedClass = classNum;
+
+ //Set stream as the selected content
+ dtps.selectedContent = "moduleStream";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.stream").addClass("active");
+
+ //Save coursework stream preference
+ window.localStorage.setItem("courseworkPref-" + classID, "moduleStream");
+
+ //Load class color, name, etc.
+ dtps.presentClass(classNum);
+
+ //Ensure classes are shown in the sidebar
+ dtps.showClasses();
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.moduleStream");
+ }
+
+ //Show loading indicator
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "moduleStream")) {
+ jQuery(".classContent").html(dtps.renderStreamTools(classNum, "modules") + /*html*/`
+ <div class="module card collapsed">
+ <h4>
+ <i class="fluid-icon collapseIcon shimmer">star</i>
+ <span class="shimmer">[SHIMMER] Module title (collapsed)</span>
+ </h4>
+ <div class="moduleContents" style="padding-top: 10px;"></div>
+ </div>
+ <div class="module card">
+ <h4>
+ <i class="fluid-icon collapseIcon shimmer">star</i>
+ <span class="shimmer">[SHIMMER] Module title</span>
+ </h4>
+
+ <div class="moduleContents" style="padding-top: 10px;">
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ <div class="moduleItem shimmer">[SHMMER] module item</div>
+ </div>
+ </div>
+ `);
+ }
+
+ new Promise(resolve => {
+ if (dtps.classes[classNum].modules && (dtps.classes[classNum].modules !== true)) {
+ resolve(dtps.classes[classNum].modules);
+ } else {
+ dtpsLMS.fetchModules(dtps.user.id, dtps.classes[classNum].lmsID).then(data => resolve(data));
+ }
+ }).then(data => {
+ //Save modules data in the class object for future use
+ dtps.classes[classNum].modules = data;
+
+ var modulesHTML = dtps.renderStreamTools(classNum, "modules");
+ var allCollapsed = true;
+
+ data.forEach(module => {
+ var moduleItemHTML = "";
+ if (!module.collapsed) allCollapsed = false;
+
+ //Get HTML for each module item
+ module.items.forEach(item => {
+ //Get module item icon
+ var icon = "list";
+ if (item.type == "assignment") icon = "assignment";
+ if (item.type == "page") icon = "insert_drive_file";
+ if (item.type == "discussion") icon = "forum";
+ if (item.type == "url") icon = "open_in_new";
+ if (item.type == "header") icon = "format_size";
+ if (item.type == "embed") icon = "web";
+
+ //Get module action
+ var action = "";
+ if (item.type == "assignment") action = "dtps.assignment('" + item.id + "', " + classNum + ")";
+ if (item.type == "page") {
+ action = "fluid.screen('pages', '" + classID + "|" + item.id + "|true')";
+ }
+ if (item.type == "discussion") {
+ action = "fluid.screen('discussions', '" + classID + "|" + item.id + "|true')";
+ }
+ if (item.type == "url") action = "window.open('" + item.url + "')";
+ if (item.type == "header") action = "";
+ if (item.type == "embed") action = "dtps.showIFrameCard('" + item.url + "')";
+
+ //Get module HTML
+ if (item.type == "header") {
+ moduleItemHTML += `<h5 style="font-size: 16px;padding: 0px 10px; text-decoration: underline;">${item.title}</h5>`;
+ } else {
+ moduleItemHTML += `
+ <div class="moduleItem" onclick="${action}" style="margin-left: ${item.indent * 15}px;">
+ <i ${item.completed ? `style="color: #27ba3c"` : ""} class="fluid-icon">${item.completed ? "check" : icon}</i>
+ ${item.title}
+ </div>
+ `;
+ }
+ });
+
+ //Add HTML for this module to the string
+ modulesHTML += /*html*/`
+ <div class="module card ${module.collapsed ? "collapsed" : ""}">
+ <h4>
+ <i onclick="dtps.moduleCollapse(this, '${dtps.classes[classNum].id}', '${module.id}');"
+ class="fluid-icon collapseIcon">${module.collapsed ? "keyboard_arrow_right" : "keyboard_arrow_down"}</i>
+ ${module.title}
+ </h4>
+
+ <div class="moduleContents" style="padding-top: 10px;">
+ ${moduleItemHTML}
+ </div>
+ </div>
+ `;
+ });
+
+ if (data.length == 0) {
+ modulesHTML += /*html*/`
+ <div style="text-align: center;">
+ <div style="margin: 60px; padding: 20px 40px; display: inline-block; border: 2px solid var(--elements); border-radius: var(--elementRadius);">
+ <h5>No Modules</h5>
+ <p>There aren't any modules in this class yet.</p>
+ </div>
+ </div>
+ `;
+ }
+
+ //Render module HTML
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "moduleStream")) {
+ $(".classContent").html(modulesHTML);
+ if (dtpsLMS.collapseAllModules) {
+ $("#moduleExpandCollapse").html(allCollapsed ? `<i class="fluid-icon">unfold_more</i> Expand all` : `<i class="fluid-icon">unfold_less</i> Collapse all`);
+ $("#moduleExpandCollapse").attr("onclick", allCollapsed ? `dtps.moduleCollapseAll(false)` : `dtps.moduleCollapseAll(true)`);
+ $("#moduleExpandCollapse").show();
+ }
+ }
+ }).catch(err => {
+ dtps.error("Could not load modules", "Caught promise rejection @ dtps.moduleStream", err);
+ });
+}
+
+/**
+ * Collapses a module
+ *
+ * @param {Element} ele Element of the module collapse arrow
+ * @param {string} classID Class ID
+ * @param {string} modID Module ID of the module to collapse
+ */
+dtps.moduleCollapse = function (ele, classID, modID) {
+ //Add collapsed class to module card
+ $(ele).parents('.card').toggleClass('collapsed');
+
+ //Update arrow icon and, if the LMS supports it, collapse the module in the LMS as well
+ if ($(ele).parents('.card').hasClass('collapsed')) {
+ if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, true);
+ $(ele).html('keyboard_arrow_right');
+ dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = true;
+ } else {
+ if (dtpsLMS.collapseModule) dtpsLMS.collapseModule(classID, modID, false);
+ $(ele).html('keyboard_arrow_down');
+ dtps.classes[dtps.selectedClass].modules.find(m => m.id == modID).collapsed = false;
+ }
+
+}
+
+
+/**
+ * Collapses all module
+ *
+ * @param {boolean} collapse If true, modules will be collapsed, otherwise, they will all be expanded
+ */
+dtps.moduleCollapseAll = function (collapse) {
+ if (collapse && dtpsLMS.collapseAllModules) {
+ dtpsLMS.collapseAllModules(dtps.classes[dtps.selectedClass].lmsID, true);
+ $(".classContent .card.module h4 i").text("keyboard_arrow_right");
+ $(".classContent .module.card").addClass("collapsed");
+ dtps.classes[dtps.selectedClass].modules.forEach(m => m.collapsed = true);
+ $("#moduleExpandCollapse").html(`<i class="fluid-icon">unfold_more</i> Expand all`);
+ $("#moduleExpandCollapse").attr("onclick", `dtps.moduleCollapseAll(false)`);
+ } else if (dtpsLMS.collapseAllModules) {
+ dtpsLMS.collapseAllModules(dtps.classes[dtps.selectedClass].lmsID, false);
+ $(".classContent .card.module h4 i").text("keyboard_arrow_down");
+ $(".classContent .module.card").removeClass("collapsed");
+ dtps.classes[dtps.selectedClass].modules.forEach(m => m.collapsed = false);
+ $("#moduleExpandCollapse").html(`<i class="fluid-icon">unfold_less</i> Collapse all`);
+ $("#moduleExpandCollapse").attr("onclick", `dtps.moduleCollapseAll(true)`);
+ }
+}
+
+/**
+ * Gets stream tools HTML (search box, class info, and modules/assignment switcher)
+ *
+ * @param {number} num Class number
+ * @param {string} type Class content these tools are for (e.g. "stream")
+ * @return {string} Stream tools HTML
+ */
+dtps.renderStreamTools = function (num, type) {
+ var modulesSelector = dtps.classes[num].modules;
+ return /*html*/`
+ ${(type == "modules") || (type == "stream") ? /*html*/`
+ <div style="text-align: right;${modulesSelector ? "" : "margin-top: 20px;"}">
+ ${modulesSelector ? /*html*/`
+ ${(type == "modules") && dtpsLMS.collapseAllModules ? `<button id="moduleExpandCollapse" onclick="dtps.moduleCollapseAll()" style="margin-right:20px;display:none;" class="btn"></button>` : ""}
+ <div class="btns row small acrylicMaterial assignmentPicker" style="margin: 5px 20px 5px 0px !important;">
+ <button class="btn ${type == "stream" ? "active" : ""}" onclick="fluid.screen('stream', dtps.classes[dtps.selectedClass].id);"><i class="fluid-icon">assignment</i>Assignments</button>
+ <button class="btn ${type == "modules" ? "active" : ""}" onclick="fluid.screen('moduleStream', dtps.classes[dtps.selectedClass].id);"><i class="fluid-icon">view_module</i>Modules</button>
+ </div>
+ ` : ``}
+
+ </div>` : ``
+ }
+ `;
+}
+
+/**
+ * Shows the generic gradebook
+ *
+ * @param {string} classID Class ID
+ */
+dtps.gradebook = function (classID) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(classID);
+ dtps.selectedClass = classNum;
+
+ //Set stream as the selected content
+ dtps.selectedContent = "grades";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.grades").addClass("active");
+
+ //Load class color, name, etc.
+ dtps.presentClass(classNum);
+
+ //Ensure classes are shown in the sidebar
+ dtps.showClasses();
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.gradebook");
+ }
+
+ //Show loading indicator
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
+ jQuery(".classContent").html(`<div class="spinner"></div>`);
+ }
+
+ //Terminate function if the class doesn't have a letter grade or assignments
+ if (!dtps.classes[classNum].letter || !dtps.classes[classNum].assignments) {
+ return;
+ }
+
+ //Define variables for total points and zeros
+ var zeros = 0;
+ var totalPoints = 0;
+ var earnedPoints = 0;
+ var gradedAssignments = 0;
+
+ //Define variable for assignment HTML string
+ var assignmentHTML = "";
+
+ //Calculate total points and zeros
+ dtps.classes[classNum].assignments.forEach(assignment => {
+ if (assignment.grade || (assignment.grade == 0)) {
+ earnedPoints += assignment.grade;
+ gradedAssignments++;
+
+ assignmentHTML += /*html*/`
+ <div onclick="dtps.assignment('${assignment.id}', ${classNum})" class="gradebookAssignment card">
+ <h5>
+ ${assignment.title}
+
+ <div class="stats">
+ ${assignment.letter ? `<div class="gradebookLetter">${assignment.letter}</div>` : ""}
+ <div class="gradebookScore">${assignment.grade}</div>
+ <div class="gradebookValue">/${assignment.value}</div>
+ <div class="gradebookPercentage">${Math.round((assignment.grade / assignment.value) * 100)}%</div>
+ </div>
+ </h5>
+ </div>
+ `;
+ }
+
+ if (assignment.value) {
+ totalPoints += assignment.value;
+ }
+
+ if ((assignment.grade == 0) && assignment.value) {
+ zeros++;
+ }
+ })
+
+ //Grade calculation summary
+ var gradeCalcSummary = /*html*/`
+ <div style="--classColor: ${dtps.classes[classNum].color}" class="card">
+ <h3 class="gradeTitle">
+ Grade Summary
+ <div class="classGradeCircle">
+ ${dtps.classes[classNum].grade ? `<span class="percentage">${dtps.classes[classNum].grade}%</span>` : ``}
+ <div class="letter">${dtps.classes[classNum].letter || ``}</div>
+ </div>
+ </h3>
+
+ ${zeros ? /*html*/`
+ <h5 style="color: #d63d3d;" class="gradeStat">
+ Zeros
+ <div style="color: #d63d3d;" class="numFont">${zeros}</div>
+ </h5>
+ ` : ``}
+
+ <div style="${dtps.gradebookExpanded ? "" : "display: none;"}" id="genericClassGradeMore">
+ <br />
+
+ ${dtps.classes[classNum].previousLetter ? /*html*/`
+ <h5 class="smallStat">
+ Previous Grade
+ <div class="numFont">${dtps.classes[classNum].previousLetter}</div>
+ </h5>
+ ` : ``}
+
+ <h5 class="smallStat">
+ Points
+ <div class="numFont fraction">
+ <span class="earned">${earnedPoints}</span>
+ <span class="total">/${totalPoints}</span>
+ </div>
+ </h5>
+
+ <h5 class="smallStat">
+ Graded Assignments
+ <div class="numFont">${gradedAssignments}</div>
+ </h5>
+ </div>
+
+ <br />
+ <a onclick="$('#genericClassGradeMore').toggle(); if ($('#genericClassGradeMore').is(':visible')) {$(this).html('Show less'); dtps.gradebookExpanded = true;} else {$(this).html('Show more'); dtps.gradebookExpanded = false;}"
+ style="color: var(--secText, gray); cursor: pointer; margin-right: 10px;">${dtps.gradebookExpanded ? "Show less" : "Show more"}</a>
+ </div>
+
+ <br />
+ `;
+
+
+ //Render HTML
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
+ $(".classContent").html(gradeCalcSummary + assignmentHTML);
+ }
+}
+
+//Fluid UI screen definitions
+fluid.externalScreens.dashboard = () => {
+ dtps.mainStream();
+}
+
+fluid.externalScreens.stream = (courseID) => {
+ dtps.classStream(courseID);
+}
+
+fluid.externalScreens.moduleStream = (courseID) => {
+ dtps.moduleStream(courseID);
+}
+
+fluid.externalScreens.gradebook = (courseID) => {
+ dtps.gradebook(courseID);
+}
+
+//Type definitions
+
+/**
+* @typedef {Object} Assignment
+* @description Defines assignments objects in DTPS
+* @property {string} title Title of the assignment
+* @property {string} [body] HTML of the assignment's body
+* @property {string} id Assignment ID
+* @property {number} class Automatically managed by DTPS. The class number that this assignment belongs to.
+* @property {Date} [dueAt] Assignment due date
+* @property {string} [url] Assignment URL
+* @property {AssignmentFeedback[]} [feedback] Feedback / private comments for this assignment
+* @property {User} [grader] Assignment grader
+* @property {boolean} [turnedIn] True if the assignment is turned in
+* @property {boolean} [late] True if the assignment is late
+* @property {boolean} [missing] True if the assignment is missing
+* @property {boolean} [locked] True if assignment submissions are locked
+* @property {string} [category] Assignment category
+* @property {Date} [publishedAt] Date for when the assignment was published
+* @property {Date} [gradedAt] Date for when the assignment was graded
+* @property {number} [grade] Points earned on this assignment
+* @property {string} [letter] Letter grade on this assignment
+* @property {number} [value] Total amount of points possible for this assignment
+* @property {RubricItem[]} [rubric] Assignment rubric
+*/
+
+/**
+* @typedef {Object} Module
+* @description Defines module objects in DTPS
+* @property {string} title Title of the module
+* @property {string} id Module ID
+* @property {boolean} [collapsed] True if the module is collapsed, false otherwise. undefined or null if this module does not support collapsing.
+* @property {ModuleItem[]} items An array of items for this module.
+*/
+
+/**
+ * @typedef {Object} ModuleItem
+ * @description Defines module items in DTPS
+ * @property {string} type Either "assignment", "page", "discussion", "url", "embed", or "header".
+ * @property {string} [title] Required for URL and header items, and can be used to override the title of assignment, page, and discussion items.
+ * @property {string} [id] Required for assignment, page, and discussion items.
+ * @property {string} [url] Required for URL and embed items. Required for discussion and page items if the class does not support the pages or discussions feature.
+ * @property {number} [indent] Indent level
+ * @property {boolean} [completed] True if the module item has been completed
+ */
+
+/**
+* @typedef {Object} Announcement
+* @description Defines announcement objects in DTPS
+* @property {string} title Title of the announcement
+* @property {Date} postedAt Date when the announcement was posted
+* @property {string} body Announcement content
+* @property {string} url Announcement URL
+*/
+
+/**
+* @typedef {Object} AssignmentFeedback
+* @description Defines assignment feedback objects in DTPS
+* @property {string} comment Feedback comment
+* @property {User} [author] Feedback author
+*/
+
+/**
+* @typedef {Object} RubricItem
+* @description Defines rubric item objects in DTPS
+* @property {string} title Title of the rubric item
+* @property {string} id Rubric item ID (only needs to be unique to this assignment)
+* @property {number} value Total amount of points possible
+* @property {string} [outcome] The ID of the outcome this rubric item is assessing. This is only used for grade calculation.
+* @property {string} [description] Rubric item description
+* @property {number} [score] Rubric assessment score in points
+* @property {string} [scoreName] Rubric assessment score name
+* @property {string} [color] Score color in a CSS color format
+*/
+
+/**
+ * @typedef {Object} DashboardItem
+ * @description Defines dashboard items in DTPS
+ * @property {string} name Dashbord item name
+ * @property {string} id Unique dashboard item ID
+ * @property {string} icon Dashboard item icon
+ * @property {boolean} supportsCompactMode True if this dashboard item supports compact mode
+ * @property {number} size The approximate size of this dashboard item relative to other dashboard items. Should be no less than 20.
+ * @property {string} defaultSide The default side of this dashboard item. Either "right" or "left".
+ * @property {boolean} compact True if the user has turned on compact mode for this item.
*/
\ No newline at end of file
diff --git a/scripts/core.js b/scripts/core.js
index 399401b..0e6911a 100644
--- a/scripts/core.js
+++ b/scripts/core.js
@@ -1,2263 +1,2286 @@
-/**
- * @file DTPS Core functions and module loader
- * @author jottocraft
- * @version v3.1.0
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-//Make sure DTPS isn't already loading
-if (typeof dtps !== "undefined") throw "Error: DTPS is already loading";
-
-/**
- * Global DTPS object
- * All global DTPS functions and variables are stored in this object
- *
- * @global
- * @namespace dtps
- * @property {number} ver Comparable version number
- * @property {string} env DTPS enviornment ("prod" or "dev")
- * @property {string} readableVer Formatted semantic version number
- * @property {Class[]} classes Array of classes the current user is in
- * @property {string} baseURL The base URL that DTPS is being loaded from
- * @property {boolean} unstable This is true if loading an unstable version of DTPS
- * @property {boolean} gradebookExpanded True if gradebook details (Show more...) is open. Used in the generic gradebook and may be used in custom gradebook implementations.
- * @property {string|undefined} popup Popup to show when loaded. Either undefined (no popup), "firstrun", or "changelog".
- * @property {User} user Current user, fetched with dtps.init
- * @property {number|string} selectedClass The selected class number, or "dash" if the dashboard is selected. Set when the first screen is loaded in dtps.init.
- * @property {string} selectedContent The selected class content/tab. Set when the first class content is loaded. Defaults to "stream".
- * @property {number|undefined} bgTimeout Background transition timeout when switching between classes
- * @property {Array<Assignment|Announcement>} updates Array of up to 10 recently graded assignments or announcements.
- * @property {DashboardItem[]} dashboardItems Array of items that can be shown on the dashboard
- * @property {DashboardItem[]} leftDashboard Items on the left side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
- * @property {DashboardItem[]} rightDashboard Items on the right side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
- * @property {object} remoteConfig Configuration variables that can be remotely changed
- * @property {boolean} searchScrollListener True if the search scroll listener has been added
- */
-var dtps = {
- ver: 310,
- readableVer: "v3.1.0",
- env: new URL(window.dtpsBaseURL || "https://powerplus.app").hostname == "localhost" ? "dev" : window.jottocraftSatEnv || "prod",
- classes: [],
- baseURL: window.dtpsBaseURL || "https://powerplus.app",
- unstable: window.dtpsBaseURL !== "https://powerplus.app",
- gradebookExpanded: false,
- updates: [],
- dashboardItems: [
- {
- name: "Calendar",
- id: "dtps.calendar",
- icon: "event",
- size: 100,
- defaultSide: "left"
- }, {
- name: "Updates",
- id: "dtps.updates",
- icon: "calendar_view_day",
- size: 170,
- defaultSide: "left"
- }, {
- name: "Due Today",
- id: "dtps.dueToday",
- icon: "check_circle_outline",
- size: 20,
- defaultSide: "right"
- }, {
- name: "Upcoming Assignments",
- id: "dtps.upcoming",
- icon: "view_stream",
- size: 250,
- defaultSide: "right"
- }
- ],
- remoteConfig: {
- showBugReportButton: false,
- gradeCalculationEnabled: true,
- allowWhatIfGrades: true,
- showVideoMeetingButton: true,
- dtechHomepageFluidUITabs: true,
- dtechCurrentTerm: "20-21",
- debugClassID: "1098",
- topSneaky: false,
- topSneakyUI: false,
- remoteUpdate: {
- title: null,
- md: null,
- active: false
- }
- }
-};
-
-//Load jQuery ASAP
-jQuery.getScript("https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js");
-
-/**
- * Debugging shortcut for getting the selected class. This should only be used in the web inspector and not in actual code.
- *
- * @return {object|undefined} The selected class
- */
-dtps.class = function () {
- return dtps.classes[dtps.selectedClass];
-}
-
-/**
- * Fetches and displays the DTPS changelog modal
- *
- * @param onlyIfNewVersion True if the changelog should only show if this is a new version
- */
-dtps.changelog = function (onlyIfNewVersion) {
- //Fetch latest changelog from GitHub releases
- jQuery.getScript("https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js", function () {
- markdown = new showdown.Converter();
- jQuery.getJSON("https://api.github.com/repos/jottocraft/dtps/releases/latest", function (data) {
- //Convert changelog to HTML and render in the changelog card
- var changelogHTML = markdown.makeHtml(data.body);
- jQuery(".card.changelog").html(`<i onclick="fluid.cards.close('.card.changelog')" class="material-icons close">close</i>` + changelogHTML);
-
- if (!onlyIfNewVersion) {
- //Show changelog
- fluid.cards.close(".card.focus");
- fluid.cards(".card.changelog");
- } else if (Number(data.tag_name.replace(/[^0-9]/g, '')) > Number(window.localStorage.dtps)) {
- //Show changelog if this is a new(er) version
- localStorage.setItem('dtps', data.tag_name.replace(/[^0-9]/g, ''));
-
- if (!data.tag_name.includes("s")) {
- //s in tag_name means a silent release
- fluid.cards.close(".card.focus");
- fluid.cards(".card.changelog");
- }
- }
- });
- });
-};
-
-/**
- * Logs debugging messages
- *
- * @param {string} msg The debugging message to log
- */
-dtps.log = function (msg) {
- if (dtps.env == "dev") console.log("[DTPS]", msg);
-}
-
-
-/**
- * Shows an error message alert and logs to console
- *
- * @param {string} msg The error to display
- * @param {string} [devNotes] Technical error details displayed in a smaller font
- * @param {Error} [err] An error object to log to the console. If this is null, DTPS will assume the error has been handled elsewhere.
- */
-dtps.error = function (msg, devNotes, err) {
- if (err !== null) {
- var formattedDevNotes = "";
- if (devNotes) {
- formattedDevNotes = '<div style="font-size: 12px; color: var(--secText, gray); margin-top: 10px;">' + devNotes + '</div>';
- }
- console.error("[DTPS !!ERROR!!]", devNotes + ": ", err);
- fluid.alert("Error", msg + formattedDevNotes, "error");
- }
-}
-
-/**
- * Renders "Welcome to Project DTPS" screen on the first run
- */
-dtps.firstrun = function () {
- //Set latest changelog version to current version
- window.localStorage.setItem('dtps', dtps.ver);
-
- //Welcome to DTPS screen HTML
- jQuery(".card.changelog").html(/*html*/`
- <h3 style="margin-bottom: 0px;">Welcome to Power+</h3>
- <h5 style="color: var(--secText); font-weight: bold; font-size: 22px;">${dtps.readableVer}</h5>
-
- <div class="welcomeSection">
- <i class="material-icons">dashboard</i>
- <h5>${dtpsLMS.gradebook ? "Manage your coursework and grades" : "Manage your coursework"}</h5>
- <p>Power+ organizes all of your coursework so you can easily see what you need to do next. The dashboard shows upcoming assignments, recent grades, and announcements.
- ${dtpsLMS.gradebook ? `Power+ includes a gradebook designed for ${dtpsLMS.name} to help you understand your grades.` : ``}</p>
- </div>
-
- ${dtpsLMS.isDemoLMS ? /*html*/`
- <div class="welcomeSection">
- <i class="material-icons">priority_high</i>
- <h5>This is a demo</h5>
- <p>Assignment information, grades, and other content displayed is not real and is for demonstration purposes only. This demo does not retrieve or collect any data.</p>
- </div>
- ` : /*html*/`
- <div class="welcomeSection">
- <i class="material-icons">security</i>
- <h5>Privacy</h5>
- <p>Power+ does not collect any information. All of the data used in Power+ is fetched directly from ${dtpsLMS.shortName} and is never sent anywhere else.
- User preferences, grade history, and other Power+ data is stored locally on your computer and is not associated with your ${dtpsLMS.shortName} account.</p>
- </div>
- <div class="welcomeSection">
- <i class="material-icons">priority_high</i>
- <h5>Power+ is not official</h5>
- <p>Assignment information, grades, and other content displayed in Power+ are not official. Power+ is neither created nor endorsed by ${dtpsLMS.legalName}.
- Power+ may have bugs that could cause it to display inaccurate information. Use Power+ at your own risk.</p>
- </div>
- `}
-
- <br />
- <button onclick="window.localStorage.setItem('dtpsInstalled', 'true'); fluid.cards.close('.card.changelog');" class="btn">
- <i class="material-icons">arrow_forward</i> Continue
- </button>
- `);
-
- //Show Welcome to DTPS card
- fluid.cards.close(".card.focus");
- fluid.cards(".card.changelog", "stayOpen");
-};
-
-/**
- * Renders the DTPS loading screen
- */
-dtps.renderLoadingScreen = function () {
- if (!window.dtpsPreLoader || dtps.user) {
- //Only show the loader if the extension hasn't already shown it
- jQuery("body").append(/*html*/`
- <div id="dtpsNativeOverlay" style="background-color: #151515; position: fixed; top: 0px; left: 0px; width: 100%; height: 100vh; z-index: 99;text-align: center;z-index: 999;transition: opacity 0.2s;">
- <img style="height: 100px; margin-top: 132px;" src="https://i.imgur.com/7dDUVh2.png" />
- <br />
- <div class="progress"><div class="indeterminate"></div></div>
- <style>body {background-color: #151515; overflow: hidden;}*,:after,:before{box-sizing:border-box}.progress{position:relative;width:600px;height:5px;overflow:hidden;border-radius:12px;background:#262626;backdrop-filter:opacity(.4);display:inline-block;margin-top:75px}.progress .indeterminate{position:absolute;background:#e3ba4b;height:5px;animation:indeterminate 1.4s infinite;animation-timing-function:linear}@keyframes indeterminate{0%{width:5%;left:-15%}to{width:100%;left:110%}}</style>
- </div>
- `);
- }
-}
-
-/**
- * Load all external JavaScript libraries
- *
- * @param {function} cb Callback function
- */
-dtps.JS = function (cb) {
- //Moment & Fullcalendar are used for the calendar on the dashboard
- jQuery.getScript("https://cdn.jsdelivr.net/npm/[email protected]/main.min.js", function () {
- jQuery.getScript("https://cdn.jsdelivr.net/npm/[email protected]/locales-all.min.js");
- });
-
- //Lunr is used for search
- jQuery.getScript('https://unpkg.com/[email protected]/lunr.min.js');
-
- //jQuery UI for dashboard settings page
- jQuery.getScript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js');
-
- //Tinycolor used for better dark mode support
- jQuery.getScript("https://cdn.jottocraft.com/tinycolor.js");
-
- //dtao/nearest-color is used for finding the nearest class color
- jQuery.getScript("https://cdn.jottocraft.com/nearest-color.dtao.js", () => {
- //Fluid UI for core UI elements
- jQuery.getScript('https://cdn.jottocraft.com/fluid/v5.min.js', cb);
- });
-}
-
-/**
- * Load all DTPS CSS files
- */
-dtps.CSS = function () {
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
- href: "https://cdn.jottocraft.com/fluid/v5.min.css",
- class: "dtpsHeadItem"
- }).appendTo("head");
-
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
- href: dtps.baseURL + "/dtps.css",
- class: "dtpsHeadItem"
- }).appendTo("head");
-
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
- href: "https://fonts.googleapis.com/css?family=Material+Icons+Round",
- class: "dtpsHeadItem"
- }).appendTo("head");
-
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
- href: "https://cdn.jsdelivr.net/npm/[email protected]/main.min.css",
- class: "dtpsHeadItem"
- }).appendTo("head");
-
- jQuery("<link/>", {
- rel: "stylesheet",
- type: "text/css",
- href: "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css",
- class: "dtpsHeadItem"
- }).appendTo("head");
-}
-
-/**
- * Starts DTPS (entrypoint function)
- */
-dtps.init = function () {
- //Initial log
- dtps.log("Starting DTPS " + dtps.readableVer + "...");
-
- //Check for LMS config
- if (!window.dtpsLMS) {
- throw "Error: No DTPS LMS configuration found";
- }
-
- //Determine if changelog should be shown
- if (Number(window.localStorage.dtps) < dtps.ver) {
- dtps.log("New release");
- dtps.popup = "changelog";
- }
-
- //Determine if this is the first time loading DTPS
- if (window.localStorage.dtpsInstalled !== "true") {
- dtps.popup = "firstrun";
- }
-
- //Render loading screen
- dtps.renderLoadingScreen();
-
- //Get URL parameters
- var urlParams = new URLSearchParams(window.location.search);
- if (Array.from(urlParams).length) window.history.replaceState(null, null, window.location.pathname);
-
- //Fluid UI settings
- window.fluidConfig = {
- config: {
- autoLoad: false,
- allowThemeMenu: false //This is false because Power+ uses its own theme settings UI
- }
- };
-
- //Set env discovery
- window.localStorage.setItem("jottocraftEnv", true);
-
- //Default selected content
- dtps.selectedContent = "stream";
-
- //Begin loading CSS
- dtps.CSS();
-
- //Begin loading static DTPS HTML
- dtps.render();
-
- //Fetch remote config
- new Promise((r) => {
- jQuery.getJSON('https://project-dtps.firebaseio.com/config.json', (remoteConfig) => {
- if (remoteConfig) {
- Object.keys(remoteConfig).forEach(k => {
- var val = remoteConfig[k];
-
- dtps.remoteConfig[k] = val;
- });
- }
- r();
- }).fail(() => r());
- }).then(() => {
- //dev env remote config overrides
- if (dtps.env == "dev") {
- Object.keys(dtps.remoteConfig).forEach(k => {
- if (window.localStorage.getItem("dtpsRemoteConfig-" + k)) {
- val = window.localStorage.getItem("dtpsRemoteConfig-" + k);
-
- if (val == "true") val = true;
- if (val == "false") val = false;
-
- dtps.remoteConfig[k] = val;
- }
- });
- }
-
- //Fetch user and class data
- return dtpsLMS.fetchUser();
- }).then(data => {
- //Prevent resetting the user if the user is already set (for parent accounts)
- dtps.user = data;
-
- //If this is a parent account, show the parent UI
- if (dtps.user.children && dtps.user.children.length) {
- dtps.user.parent = true;
-
- //Fetch classes for all students
- return new Promise((resolve, reject) => {
- var allClasses = [];
- var promises = [];
-
- dtps.user.children.forEach(child => {
- promises.push(new Promise(function (resolve, reject) {
- dtpsLMS.fetchClasses(child.id).then((data) => {
- //Prepend child ID to class ID
- data.forEach(course => {
- course.id = child.id + "-" + course.id;
- course.group = child.name;
- });
-
- allClasses = allClasses.concat(data);
- resolve();
- }).catch(reject);
- }));
- });
-
- Promise.all(promises).then(() => {
- resolve(allClasses);
- });
- });
- } else {
- return dtpsLMS.fetchClasses(dtps.user.id);
- }
- }).then((rawClasses) => {
- return new Promise((resolve, reject) => {
- if (dtpsLMS.institutionSpecific && dtpsLMS.updateClasses) {
- //Using an institution-specific script, make any nessasary changes and return updated classes
- dtpsLMS.updateClasses(rawClasses).then((updatedClasses) => {
- resolve(updatedClasses);
- }).catch((e) => {
- reject(e);
- });
- } else {
- //No institution-specific script, return classes as-is
- resolve(rawClasses);
- }
- });
- }).then(classData => {
- //Store classData to dtps.classes
- dtps.classes = classData;
-
- //Add course num props
- dtps.classes.forEach((course, index) => course.num = index);
-
- //Fetch JavaScript modules
- dtps.JS(() => {
- //Define DTPS class color pallete
- var nearestCourseColor = nearestColor.from({
- //Primary color shades
- red: "#cc4747",
- brown: "#9a4429",
- orange: "#ce734e",
- pumpkin: "#c58535",
- yellow: "#b58f38",
- yellowGreen: "#7c9630",
- green: "#439a47",
- oceanGreen: "#339a70",
- keppel: "#40b5c3",
- skyBlue: "#40a4d6",
- blue: "#2d72a0",
- purple: "#985cab",
- magenta: "#bd3e69",
- pink: "#ec7ca5",
- gray: "#888888",
- //Dark color shades
- gold: "#94652a",
- darkRed: "#943f3f",
- darkBlue: "#485182",
- darkPurple: "#6f4882",
- darkGreen: "#3d7358",
- //Light color shades
- lightOrange: "#ea7a44",
- lightRed: "#e07f7f",
- lightBlue: "#76c1e6",
- lightPurple: "#978fd6",
- lightGreen: "#7ebb95",
- lightBrown: "#928871"
- });
-
- //Loop over each class to update the color and check for grade calculation
- dtps.classes.forEach(course => {
- course.color = course.color ? nearestCourseColor(course.color).value : "gray";
-
- if (dtpsLMS.calculateGrade && dtps.remoteConfig.gradeCalculationEnabled) {
- //This LMS/Institution supports grade calculation, show loading indicator for grade
- //Grade will be calculated once assignments are fetched
-
- course.letter = "..."; //Setting this to ... shows the loading indicator
- course.grade = undefined;
- }
- });
-
- //Fluid UI screens
- fluid.defaultScreen = "dashboard";
- fluid.screens.dashboard = dtps.baseURL + "/scripts/assignments.js";
- fluid.screens.stream = dtps.baseURL + "/scripts/assignments.js";
- fluid.screens.moduleStream = dtps.baseURL + "/scripts/assignments.js";
- fluid.screens.people = dtps.baseURL + "/scripts/people.js";
- fluid.screens.search = dtps.baseURL + "/scripts/search.js";
- fluid.screens.pages = dtps.baseURL + "/scripts/pages-discussions.js";
- fluid.screens.discussions = dtps.baseURL + "/scripts/pages-discussions.js";
-
- if (dtpsLMS.gradebook && !((dtps.env == "dev") && (fluid.get("pref-debuggingGenericGradebook") == "true"))) {
- //Handle LMS gradebook
- fluid.screens.gradebook = dtps.showLMSGradebook;
- } else if (dtpsLMS.genericGradebook || ((dtps.env == "dev") && (fluid.get("pref-debuggingGenericGradebook") == "true"))) {
- //Generic gradebook script
- fluid.screens.gradebook = dtps.baseURL + "/scripts/assignments.js";
- }
-
- //Begin fetching class assignments
- var fetchedAnnouncements = [];
- dtps.classes.forEach((course, courseIndex) => {
- dtpsLMS.fetchAssignments(course.userID, course.lmsID).then((rawAssignments) => {
- return new Promise((resolve, reject) => {
- if (dtpsLMS.institutionSpecific && dtpsLMS.updateAssignments) {
- //Using an institution-specific script, make any nessasary changes and return updated assignments
- dtpsLMS.updateAssignments(rawAssignments).then(updatedAssignments => {
- resolve(updatedAssignments);
- }).catch(reject);
- } else {
- //No institution-specific script, return assignments as-is
- resolve(rawAssignments);
- }
- });
- }).then(assignments => {
- //Store assignments in the class
- course.assignments = assignments;
-
- //Add class props to assignments and add recent assignments to updates array
- course.assignments.forEach(assignment => {
- assignment.class = courseIndex;
-
- if (assignment.gradedAt && assignment.grade) {
- //Add class number and type to object
- dtps.updates.push({
- class: course.num,
- type: "assignment",
- ...assignment
- })
- }
- });
-
- //Sort updates array from newest -> oldest
- dtps.updates.sort(function (a, b) {
- //Sort by postedAt (announcements) or gradedAt (assignments)
- return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
- });
-
- //Keep only the 15 most recent updates
- if (dtps.updates.length > 15) dtps.updates.length = 15;
-
- //Calculate class grade if supported
- if (dtpsLMS.calculateGrade && dtps.remoteConfig.gradeCalculationEnabled) {
- let gradeCalcResults = dtpsLMS.calculateGrade(course, assignments);
-
- if (gradeCalcResults) {
- //This class has a grade
-
- //Set course letter and grade to grade calc results
- course.letter = gradeCalcResults.letter;
- course.grade = gradeCalcResults.grade;
-
- //Save raw results object to the course so it can be accessed by the gradebook
- course.gradeCalculation = gradeCalcResults;
- } else {
- //No grade for this class
- course.letter = null;
- course.grade = null;
- }
-
- //Force re-render sidebar to show grades only if the user isn't on pages or discussions
- if ((dtps.selectedContent !== "pages") && (dtps.selectedContent !== "discuss")) {
- dtps.showClasses(true);
- }
- }
-
- //Grade history and gradebook
- if (course.letter && (course.letter !== "...")) {
- //Enable gradebook for this class
- course.hasGradebook = true;
-
- //Save grade history
- dtps.logGrades(courseIndex);
-
- //If the class is selected, call dtps.presentClass again to show the grades tab
- if (courseIndex == dtps.selectedClass) {
- dtps.presentClass(courseIndex);
-
- //If the gradebook is selected, reload the gradebook
- if (dtps.selectedContent == "grades") {
- fluid.screen('gradebook', dtps.classes[courseIndex].id);
- }
- }
- } else {
- //This class doesn't have a gradebook, exit gradebook if selected
- if ((courseIndex == dtps.selectedClass) && (dtps.selectedContent == "grades")) {
- fluid.screen('stream', dtps.classes[courseIndex].id);
- }
- }
-
- //Render grades tab in settings
- if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
-
- //Re-render screen if the dashboard or stream is selected
- if ((dtps.selectedClass == "dash") || ((dtps.selectedContent == "stream") && (dtps.selectedClass == course.num))) {
- fluid.screen();
- }
- });
-
- if (!fetchedAnnouncements.includes(course.lmsID)) {
- //Add lmsID to list of fetched announcements to prevent duplicates
- fetchedAnnouncements.push(course.lmsID);
-
- dtpsLMS.fetchAnnouncements(course.lmsID).then(announcements => {
- //Add announcements to updates array
- announcements.forEach(announcement => {
- //Add class number and type to object
- dtps.updates.push({
- class: course.num,
- type: "announcement",
- ...announcement
- });
- });
-
- //Sort updates array from newest -> oldest
- dtps.updates.sort(function (a, b) {
- //Sort by postedAt (announcements) or gradedAt (assignments)
- return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
- });
-
- //Keep only the 15 most recent updates
- if (dtps.updates.length > 15) dtps.updates.length = 15;
-
- if (dtps.selectedClass == "dash") {
- fluid.screen();
- }
- });
- }
- });
-
- //Render remaining HTML
- dtps.renderLite();
-
- //Render initial screen
- fluid.screen();
-
- //Load popup if needed
- if (dtps.popup == "firstrun") {
- dtps.firstrun();
- } else if (dtps.popup == "changelog") {
- //Changelog will only show if the release notes are on GitHub
- dtps.changelog(true);
- }
-
- //Check URL parameter
- if ((urlParams.get("prerelease") == "canary") && urlParams.get("repo")) {
- fluid.alert("Power+ Canary", "<p>Do you want to add this release configuration to Power+?</p>", "build_circle", [
- {
- name: "Add",
- icon: "add",
- action: "window.localStorage.githubCanary = '" + urlParams.get("repo") + "'; alert('Please reload the page for changes to take effect');"
- },
- {
- name: "Cancel",
- icon: "cancel"
- }
- ]);
- }
- });
- }).catch(function (err) {
- //Web request error
- console.error("[DTPS] Error fetching user and classes at dtps.init", err);
-
- //Check for login redirect
- if ((err.action == "login") && err.redirectURL) {
- //Redirect to login page
- window.location.href = err.redirectURL;
- } else {
- dtps.error("Failed to get user and/or course data", "Exception in promise @ dtps.init");
- }
- });
-
- //Load dashboard prefrences
- dtps.loadDashboardPrefs();
-}
-
-/**
- * Formats a date to a readable date string
- *
- * @param {Date} date The date to format
- * @return {string} Formatted date and time string
- */
-dtps.formatDate = function (date) {
- if (date) {
- return new Date(date).toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric', hour: "numeric", minute: "numeric" });
- } else {
- return "";
- }
-}
-
-/**
- * Adjusts the height of an iFrame to match its content
- *
- * @param {string} iframeID The ID of the iFrame element to adjust
- */
-dtps.iframeLoad = function (iframeID) {
- var iFrame = document.getElementById(iframeID);
- if (iFrame) {
- iFrame.height = "";
- iFrame.height = iFrame.contentWindow.document.body.scrollHeight + "px";
- }
-}
-
-/**
- * Clears all DTPS data
- */
-dtps.clearData = function () {
- if (window.confirm("Clearing Power+ data will clear all local user data stored by Power+. This should be done if it is a new semester / school year or if you are having issues with Power+. Are you sure you want to clear all your Power+ data?")) {
- window.localStorage.clear()
- window.alert("Power+ data cleared")
- }
-}
-
-/**
- * Renders the class list in the sidebar
- *
- * @param {boolean} [override] True if the sidebar should be forcefully re-rendered
- */
-dtps.showClasses = function (override) {
- //Array of class HTML for the sidebar
- dtps.classlist = [];
-
- var previousClassGroup = null;
- for (var i = 0; i < dtps.classes.length; i++) {
- //Determine letter grade HTML
- var letterGradeHTML = "";
- if (dtps.classes[i].letter) letterGradeHTML = dtps.classes[i].letter;
- if (dtps.classes[i].letter == null) letterGradeHTML = "--";
- if (dtps.classes[i].letter == "...") letterGradeHTML = `<div class="shimmer" style="width: 100%;height: 22px;border-radius: 8px;"></div>`; //Show loading indicator for ...
-
- if (dtps.classes[i].group && (dtps.classes[i].group !== previousClassGroup)) {
- if (previousClassGroup) dtps.classlist.push(`</div></div>`);
- dtps.classlist.push(/*html*/`
- <div id="dtpsClassListGroup-${dtps.classes[i].group}" class="group open">
- <div class="name item">
- <i class="material-icons"></i> <span class="label">${dtps.classes[i].group}</span>
- </div>
-
- <div class="items">
- `);
- } else if (!dtps.classes[i].group && previousClassGroup) {
- dtps.classlist.push(`</div></div>`);
- }
-
- //Add class HTML to array
- dtps.classlist.push(/*html*/`
- <div
- onclick="${'dtps.selectedClass = ' + i}"
- class="${'class item ' + i + ' ' + (dtps.selectedClass == i ? " active" : "")}"
- style="${'--classColor: ' + dtps.classes[i].color}"
- >
- <i class="material-icons grade">${letterGradeHTML}</i>
- <span class="label">${dtps.classes[i].subject}</span>
- </div>
- `);
-
- previousClassGroup = dtps.classes[i].group;
- }
-
- if (previousClassGroup) dtps.classlist.push(`</div></div>`);
-
- //Only render HTML if the sidebar doesn't already have the classes rendered, or if override is true
- if (!jQuery(".sidebar .class.dash")[0] || override) {
- jQuery(".sidebar").html(/*html*/`
- <div class="title">
- <img src="${dtps.baseURL + "/icon.svg"}" />
- <h4>Power+</h4>
- </div>
-
- <div class="items">
- <div onclick="dtps.selectedClass = 'dash';" class="class item main dash ${dtps.selectedClass == "dash" ? "active" : ""}">
- <i class="material-icons">dashboard</i>
- <span class="label">Dashboard</span>
- </div>
-
- <div class="divider"></div>
-
- ${dtps.classlist.join("")}
- </div>
-
- <div class="collapse">
- <i class="material-icons"></i>
- </div>
- `);
- fluid.init();
-
- //Change view to stream if coming from pages or discussions, since those tabs change the sidebar
- if ((dtps.selectedContent == "pages") || (dtps.selectedContent == "discuss")) {
- //Show stream
- if (dtps.classes[dtps.selectedClass]) fluid.screen('stream', dtps.classes[dtps.selectedClass].id);
- }
-
- //Class onclick listener
- $(".class:not(.overrideClass)").click(function (event) {
- //Load class content based on what's selected
- if (((dtps.selectedContent == "stream") || (dtps.selectedContent == "moduleStream")) && dtps.classes[dtps.selectedClass]) {
- if (dtps.classes[dtps.selectedClass].modules && (window.localStorage.getItem("courseworkPref-" + dtps.classes[dtps.selectedClass].id) == "moduleStream")) {
- fluid.screen("moduleStream", dtps.classes[dtps.selectedClass].id);
- } else {
- fluid.screen("stream", dtps.classes[dtps.selectedClass].id);
- }
- }
-
- if ((dtps.selectedContent == "people") && dtps.classes[dtps.selectedClass]) {
- fluid.screen("people", dtps.classes[dtps.selectedClass].id);
- }
-
- if ((dtps.selectedContent == "grades") && dtps.classes[dtps.selectedClass]) {
- if (dtps.classes[dtps.selectedClass].hasGradebook) {
- fluid.screen("gradebook", dtps.classes[dtps.selectedClass].id);
- } else {
- fluid.screen("stream", dtps.classes[dtps.selectedClass].id);
- }
- }
-
- if (dtps.selectedClass == "dash") {
- fluid.screen("dashboard");
- }
- });
- }
-}
-
-/**
- * Renders the class header (color, name, tabs, etc.) and sets the class as the selected class
- *
- * @param {number|string} classNum The class number to load or "dash" if loading the dashboard
- */
-dtps.presentClass = function (classNum) {
- //Set classNum as selected class
- dtps.selectedClass = classNum;
-
- //Update document title with class name
- if (dtps.classes[classNum]) {
- document.title = dtps.classes[classNum].subject + " | Power+";
- } else {
- document.title = "Power+";
- }
-
- //Set the class image
- if ((fluid.get("pref-showClassImages") !== "false") && dtps.classes[classNum] && dtps.classes[classNum].image) {
- $(".headerArea").addClass("classImage");
- $(".headerArea img").attr("src", dtps.classes[classNum].image);
- $(".headerArea img").show();
- } else {
- $(".headerArea").removeClass("classImage");
- $(".headerArea img").hide();
- }
-
- //Remove active class from other classes in the sidebar, add the active class to the selected class
- $(".sidebar .class").removeClass("active");
- $(".class." + classNum).addClass("active");
-
- //Update title to show class name
- //If the dashboard is selected, this is just "Dashboard". Otherwise, this is Class.subject
- $("#headText span").text(classNum == "dash" ? "Dashboard" : classNum == "search" ? "Search Results" : dtps.classes[classNum] && dtps.classes[classNum].subject);
- var icon = classNum == "dash" ? "dashboard" : classNum == "search" ? "search" : dtps.classes[classNum] && dtps.classes[classNum].icon
- if (icon) {
- $("#headText i").text(icon);
- $("#headText i").show();
- } else {
- $("#headText i").hide();
- }
- $("#headText").css("color", (classNum == "dash") || (classNum == "search") ? "var(--text)" : dtps.classes[classNum] && dtps.classes[classNum].color);
-
- //If the class doesn't exist, hide the tabs
- //Otherwise, show the tabs
- if (!dtps.classes[classNum]) {
- $("#dtpsTabBar").hide();
- $("#classInfo p").hide();
- } else {
- $("#dtpsTabBar").show();
- }
-
- //Hide dashboard start date
- if (classNum !== "search") $(".headerArea .contentLabel").hide();
-
- //Clear search box if not on the search tab
- if ((classNum !== "search") && !$("#dtpsMainSearchBox").is(":focus")) {
- $("#dtpsMainSearchBox").val("");
- }
-
- //Set search box content
- if (classNum !== "search") dtps.setSearchBox();
-
- if (dtps.classes[classNum]) {
- //Show pages tab if the class supports it, otherwise, hide it
- if (dtps.classes[classNum].pages) {
- $(".btns .btn.pages").show();
- } else {
- $(".btns .btn.pages").hide();
- }
-
- //Show people tab if the LMS supports it, otherwise, hide it
- if (dtps.classes[classNum].people) {
- $(".btns .btn.people").show();
- } else {
- $(".btns .btn.people").hide();
- }
-
- //Show pages tab if the class supports it, otherwise, hide it
- if (dtps.classes[classNum].discussions) {
- $(".btns .btn.discuss").show();
- } else {
- $(".btns .btn.discuss").hide();
- }
-
- //Show gradebook if the LMS and the class supports it, otherwise, hide it
- if ((dtpsLMS.genericGradebook || dtpsLMS.gradebook) && dtps.classes[classNum].hasGradebook) {
- $(".btns .btn.grades").show();
- } else {
- $(".btns .btn.grades").hide();
- }
-
- //Hide tabs if only one tab is visible
- if ($("#dtpsTabBar .btn:visible").length < 2) {
- $("#dtpsTabBar").hide();
- }
-
- //Show teacher
- if (dtps.classes[classNum].teacher) {
- $("#classInfo .teacher .teacherName").text(dtps.classes[classNum].teacher.name);
- $("#classInfo .teacher .teacherImage").css("background-image", "url('" + dtps.classes[classNum].teacher.photoURL + "')");
- $("#classInfo .teacher").show();
- } else {
- $("#classInfo .teacher").hide();
- }
-
- if (dtps.classes[classNum].homepage) {
- $("#classInfo .homepage").show();
- } else {
- $("#classInfo .homepage").hide();
- }
-
- if (dtps.classes[classNum].videoMeetingURL) {
- $("#classInfo .videoMeeting").attr("onclick", "window.open('" + dtps.classes[classNum].videoMeetingURL + "')");
- $("#classInfo .videoMeeting").removeClass("shimmerParent");
- $("#classInfo .videoMeeting").show();
- } else if ((dtps.classes[classNum].videoMeetingURL !== null) && dtpsLMS.fetchMeetingURL) {
- $("#classInfo .videoMeeting").attr("onclick", "");
- $("#classInfo .videoMeeting").addClass("shimmerParent");
- $("#classInfo .videoMeeting").show();
-
- dtpsLMS.fetchMeetingURL(dtps.classes[classNum].lmsID).then(url => {
- dtps.classes[classNum].videoMeetingURL = url;
-
- if (dtps.selectedClass == classNum) {
- if (url) {
- $("#classInfo .videoMeeting").attr("onclick", "window.open('" + dtps.classes[classNum].videoMeetingURL + "')");
- $("#classInfo .videoMeeting").removeClass("shimmerParent");
- $("#classInfo .videoMeeting").show();
- } else {
- $("#classInfo .videoMeeting").hide();
- }
- }
- });
- } else {
- $("#classInfo .videoMeeting").hide();
- }
- }
-
- console.log(dtps.selectedContent);
- if (dtps.selectedContent !== "grades") $(".classContent").removeClass("fixedGradeSummary");
-}
-
-/**
- * Displays the class homepage
- *
- * @param {number} num Class number to show the homepage for
- */
-dtps.classHome = function (num) {
- //Render loading screen
- $(".card.details").html(/*html*/`
- <i onclick="fluid.cards.close('.card.details')" class="material-icons close">close</i>
- <h3 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h3>
-
- <br />
- <p>Loading...</p>
- `);
-
- //Fetch homepage from the LMS
- dtpsLMS.fetchHomepage(dtps.classes[num].lmsID).then(homepage => {
- if (homepage) {
- //Get computed background and text color to style the iFrame with
- var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
- var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
-
- if ($("body").hasClass("dark")) {
- homepage = dtps.brightenTextForDarkMode(homepage, computedBackgroundColor);
- }
-
- if (dtpsLMS.dtech && dtps.remoteConfig.dtechHomepageFluidUITabs && ($('<div></div>').append(homepage).find(".enhanceable_content.tabs>ul>li").toArray().length > 1)) {
- //Use special tab optimized homepage
- var fragments = [];
- $('<div></div>').append(homepage).find(".enhanceable_content.tabs>ul>li").toArray().forEach((fragment) => {
- var text = $(fragment).text().toLowerCase();
- if (!text) return;
-
- var id = $(fragment).find("a").attr("href").replace("#", "");
- if (!id) return;
-
- var html = $(homepage).find("#" + id).html();
- if (!html) return;
-
- var icon = null;
- if (text.includes("agenda")) { icon = "format_list_numbered"; text = "Agenda"; }
- if (text.includes("instructor")) { icon = "person"; text = "Instructor"; }
- if (text.includes("course info")) { icon = "info"; text = "Course Info"; }
- if (text.includes("resources")) { icon = "article"; text = "Course Resources"; }
-
- //Generate a blob with the assignment body and get its data URL
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
- ${html}
- `], { type: 'text/html' });
- var frameURL = window.URL.createObjectURL(blob);
-
- fragments.push({ text, id, icon, frameURL });
- });
-
- $(".card.details").html(/*html*/`
- <i onclick="fluid.cards.close('.card.details')" class="material-icons close">close</i>
-
- <h4 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h4>
-
- <br />
- ${dtps.classes[num].videoMeetingURL ? `<button onclick="window.open('${dtps.classes[num].videoMeetingURL}')" class="btn small"><i class="material-icons">videocam</i> Zoom</button>` : ``}
- <div class="btns row small">
- ${fragments.map((fragment, i) => {
- return `<button onclick="$(this).addClass('active');$(this).siblings().removeClass('active');$('#homepageFragment').attr('src', '${fragment.frameURL}'); dtps.iframeLoad('homepageFragment');"
- style="text-transform: capitalize;" class="btn ${i == 0 ? "active" : ""}">${fragment.icon ? `<i class="material-icons">${fragment.icon}</i> ` : ""}${fragment.text}</button>`;
- }).join("")}
- </div>
-
- <br />
- <div style="margin-top: 20px;" class="homepageBody">
- <iframe id="homepageFragment" onload="dtps.iframeLoad('homepageFragment')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${fragments[0].frameURL}" />
- </div>
- `);
- } else {
- //Generate a blob with the assignment body and get its data URL
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
- ${homepage}
- `], { type: 'text/html' });
- var homepageURL = window.URL.createObjectURL(blob);
-
- $(".card.details").html(/*html*/`
- <i onclick="fluid.cards.close('.card.details')" class="material-icons close">close</i>
-
- <h4 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h4>
-
- <br />
- <div style="margin-top: 20px;" class="homepageBody">
- <iframe id="homepageIframe" onload="dtps.iframeLoad('homepageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${homepageURL}" />
- </div>
- `);
- }
-
- fluid.cards(".card.details");
- } else {
- fluid.cards.close('.card.details');
- dtps.error("Homepage unavailable", "homepage is either empty or undefined @ dtps.classHome");
- }
- }).catch(e => {
- dtps.error("Couldn't load homepage", "Caught a promise rejection @ dtps.classHome", e);
- })
-}
-
-/**
- * Shows the gradebook using HTML from dtpsLMS.gradebook
- *
- * @param {string} classID Class ID
- */
-dtps.showLMSGradebook = function (classID) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(classID);
- dtps.selectedClass = classNum;
-
- //Set stream as the selected content
- dtps.selectedContent = "grades";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.grades").addClass("active");
-
- //Load class color, name, etc.
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.showLMSGradebook");
- }
-
- //Show loading indicator
- if ((dtps.selectedContent == "grades") && (dtps.selectedClass == classNum)) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
- }
-
- //Function to load gradebook HTML
- function renderGradebook() {
- dtpsLMS.gradebook(dtps.classes[classNum]).then(html => {
- if (html && (dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
- $(".classContent").html(html);
- if (dtpsLMS.gradebookDidRender) dtpsLMS.gradebookDidRender(dtps.classes[classNum]);
- }
- }).catch(function (err) {
- dtps.error("Could not load the gradebook", "Caught promise rejection @ dtps.showLMSGradebook", err);
- });
- }
-
- if (!fluid.externalScreens.stream) {
- //Load assignment functions first
- jQuery.getScript(dtps.baseURL + "/scripts/assignments.js", () => {
- renderGradebook();
- })
- } else {
- renderGradebook();
- }
-}
-
-/**
- * Shows a URL in the iFrame card
- *
- * @param {string} url The URL to load
- */
-dtps.showIFrameCard = function (url) {
- //Remove any previous URLs
- $('#CardIFrame').attr('src', '');
-
- //Show iFrame card
- fluid.cards('.card.iFrameCard');
-
- //Load new URL
- $('#CardIFrame').attr('src', url);
-}
-
-/**
- * Brightens text in an HTML string for dark mode
- *
- * @param {string} html The HTML to brighten text for
- * @param {string} [bg] The background color that the HTML will be displayed on
- * @returns {string} HTML string with brightened colors
- */
-dtps.brightenTextForDarkMode = function (html, bg) {
- //Use dark mode algorithm
- if (!bg) bg = "black";
- var fakeRoot = $('<div></div>').append(html);
- fakeRoot.find("span").filter(function () {
- return $(this).css("color") && !($(this).css("background-color") || $(this).css("background")) && !$(this).parents().filter(function () {
- return $(this).css("background-color") || $(this).css("background");
- }).length;
- }).toArray().forEach(element => {
- //Brighten color
- var brightness = tinycolor($(element).css("color")).getBrightness() / 255 * 100;
- var targetBrightness = (100 - (tinycolor(bg).getBrightness() / 255 * 100)) - brightness;
- var brightnessDiff = targetBrightness - brightness;
-
- if (brightnessDiff > 0) {
- $(element).css("color", "#" + tinycolor($(element).css("color")).brighten(Math.abs(brightnessDiff)).toHex());
- } else {
- $(element).css("color", "#" + tinycolor($(element).css("color")).darken(Math.abs(brightnessDiff)).toHex());
- }
- });
- return fakeRoot.html();
-}
-
-/**
- * Stores grade data locally for the previous grade feature
- *
- * @param classNum Class number to log grade
- */
-dtps.logGrades = function (classNum) {
- /*
- Grade change vars:
- gradeHistory-ID: current|previous (e.g. "A|B+" represents a change of B+ -> A)
- if there is only one grade, it is the current one
- */
- if (window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id)) {
- var savedCurrent = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[0];
- var savedPrevious = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[1];
-
- if (savedCurrent !== dtps.classes[classNum].letter) {
- //Grade change
- window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter + "|" + savedCurrent);
- dtps.classes[classNum].previousLetter = savedCurrent;
- }
-
- if ((savedCurrent == dtps.classes[classNum].letter) && savedPrevious) {
- //Previous grade is already saved
- dtps.classes[classNum].previousLetter = savedPrevious;
- }
- } else {
- //No history yet, store current grade
- window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter);
- }
-}
-
-/**
- * Opens the settings page
- *
- * @param {boolean} [forceRerenderDashboard] If this is true, the dashboard settings will be re-rendered
- */
-dtps.settings = function (forceRerenderDashboard) {
- //Render dashboard HTML if not already loaded
- if (forceRerenderDashboard || ($("#leftDashboardColumn").attr("loaded") !== "true")) {
- //Returns dashboard item HTML from a dashboard item array
- function dashboardHTML(dashboardArray) {
- return dashboardArray.map(dashboardItem => {
- return /*html*/`
- <div dashboardItem-id="${dashboardItem.id}" style="height: ${dashboardItem.size * 1.7 + 50}px" class="dashboardItem">
- <h5>
- <i class="material-icons">${dashboardItem.icon}</i>
- <span>${dashboardItem.name}</span>
- </h5>
- </div>
- `;
- }).join("");
- }
-
- //Render dashboard items
- $("#leftDashboardColumn").html(dashboardHTML(dtps.leftDashboard));
- $("#rightDashboardColumn").html(dashboardHTML(dtps.rightDashboard));
-
- //Make dashboard items sortable
- $(".dashboardColumn").sortable({
- connectWith: ".dashboardColumn",
- update: function (e, ui) {
- dtps.saveDashboardPrefs();
- }
- });
-
- //Store loaded state to prevent reloading dashboard items
- $("#leftDashboardColumn").attr("loaded", "true");
- }
-
- //Render grades tab in settings
- if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
-
- fluid.cards('.settingsCard');
-}
-
-/**
- * Shows a warning telling the user that they must reload for setting changes to take effect
- */
-dtps.settingsReloadWarning = function () {
- $("#settingsReloadWarning").show();
-}
-
-/**
- * Renders the grades tab in settings
- */
-dtps.renderGradesInSettings = function () {
- //Render class grade bars
- $("#classGradeBars").html(dtps.classes.map(course => {
- //Percentages below are for visualization purposes only
- var percentage = 0;
- if (course.letter == "A") percentage = 100;
- if (course.letter == "A-") percentage = 91;
- if (course.letter == "B+") percentage = 88;
- if (course.letter == "B") percentage = 85;
- if (course.letter == "B-") percentage = 81;
- if (course.letter == "C+") percentage = 78;
- if (course.letter == "C") percentage = 75;
-
- return (
- course.letter ? `<div style="cursor: auto; background-color: var(--elements);" class="progressBar big">
- <div style="color: white;" class="progressLabel">${course.subject} (${course.letter})</div>
- <div class="progress" style="background-color: ${course.color}; width: calc(${percentage}% - 300px);"></div></div>` : ""
- )
- }));
-
- //Calculate GPA
- var sum = 0;
- var values = 0;
-
- dtps.classes.forEach(course => {
- if (course.letter == "...") {
- sum = null;
- } else if (course.letter && (sum !== null)) {
- var points = 0;
- if (course.letter == "A") points = 4;
- if (course.letter == "A-") points = 3.7;
- if (course.letter == "B+") points = 3.3;
- if (course.letter == "B") points = 3;
- if (course.letter == "B-") points = 2.7;
- if (course.letter == "C+") points = 2.3;
- if (course.letter == "C") points = 2.0;
- if (course.letter == "I") points = 0;
-
- sum += points;
- values++;
- }
- })
-
- if (sum == null) {
- $("#dtpsGpaText").text("...");
- } else {
- $("#dtpsGpaText").text((sum / values).toFixed(1));
- }
-}
-
-/**
- * Saves dashboard prefrences
- */
-dtps.saveDashboardPrefs = function () {
- var dashboardPrefs = [];
-
- //Add dashboard items
- for (var i = 0; i < $(".dashboardColumn").children().length; i++) {
- //Get HTML item
- var child = $($(".dashboardColumn").children()[i]);
-
- //Add item to dashboardPrefs array
- dashboardPrefs.push({
- id: child.attr("dashboardItem-id"),
- side: child.parent().attr("id").includes("left") ? "left" : "right"
- });
- }
-
- //Save to local storage
- window.localStorage.setItem("dtpsDashboardItems", JSON.stringify(dashboardPrefs));
-
- //Reload dashboard items
- dtps.loadDashboardPrefs();
-}
-
-/**
- * Resets dashboard prefrences
- */
-dtps.resetDashboardPrefs = function () {
- //Remove dashboard pref from localStorage
- window.localStorage.removeItem("dtpsDashboardItems");
-
- //Reload dashboard items
- dtps.loadDashboardPrefs();
-
- //Re-render dashboard
- dtps.settings(true);
-}
-
-/**
- * Redirects to DTPS classic edition
- */
-dtps.classicEntry = function () {
- var classicName = ["P", "r", "o", "j", "e", "c", "t", " ", "D", "T", "P", "S"];
- var overwrittenHTML = ["P", "o", "w", "e", "r", "+"];
- if (dtps.classicStep == undefined) dtps.classicStep = -10;
- dtps.classicStep++;
-
- if (dtps.classicStep == 12) window.location.href = "/power+?classicEdition=true";
-
- for (var i = 0; i < dtps.classicStep; i++) {
- overwrittenHTML[i] = classicName[i];
- }
-
- $("#dtpsAboutName").html(overwrittenHTML.join(""));
-}
-
-/**
- * Loads dashboard prefrences
- */
-dtps.loadDashboardPrefs = function () {
- //Define left and right dashboard columns
- dtps.leftDashboard = [];
- dtps.rightDashboard = [];
-
- //Add items to dashboard columns
- if (window.localStorage.dtpsDashboardItems) {
- //Add from user prefs
-
- //Parse JSON
- var dashboardPref = JSON.parse(window.localStorage.dtpsDashboardItems);
-
- //Generate arrays of dashboard item IDs
- var dashboardIDs = dtps.dashboardItems.map(item => item.id);
-
- //Add items to dashboard according to prefs
- dashboardPref.forEach(dashboardItemPref => {
- if (dashboardIDs.includes(dashboardItemPref.id)) {
- //Get item index based on dashboardIDs array
- var itemIndex = dashboardIDs.indexOf(dashboardItemPref.id);
-
- //Get item from dtps.dashboardItems array
- var dashboardItem = dtps.dashboardItems[itemIndex];
-
- //Add item to dashboard
- if (dashboardItemPref.side == "left") {
- dtps.leftDashboard.push(dashboardItem);
- } else if (dashboardItemPref.side == "right") {
- dtps.rightDashboard.push(dashboardItem);
- }
- }
- });
- } else {
- //Add from defaults
- dtps.dashboardItems.forEach(dashboardItem => {
- if (dashboardItem.defaultSide == "left") {
- dtps.leftDashboard.push(dashboardItem);
- } else if (dashboardItem.defaultSide == "right") {
- dtps.rightDashboard.push(dashboardItem);
- }
- })
- }
-}
-
-/**
- * Renders initial static DTPS HTML
- */
-dtps.render = function () {
- //Remove all existing link tags and LMS head content
- $("link:not(.dtpsHeadItem)").remove();
- $("head *:not(.dtpsHeadItem)").remove();
-
- //Set default body classes
- $("body").attr("class", "dark showThemeWindows hasSidebar hasNavbar dashboard");
-
- //Set document title and favicon
- document.title = "Power+";
- jQuery("<link/>", {
- rel: "shortcut icon",
- type: "image/png",
- href: dtps.baseURL + "/favicon.png"
- }).appendTo("head");
-
- //Remove existing LMS HTML (excluding DTPS loading screen HTML)
- jQuery("body *:not(#dtpsNativeOverlay):not(#dtpsNativeOverlay *)").remove();
-
- //Render HTML
- jQuery("body").append(/*html*/`
- <div class="sidebar acrylicMaterial"></div>
-
- <div class="navbar">
- <div class="logo">
- <img src="${dtps.baseURL + "/icon.svg"}" />
- <h4>${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
- </div>
-
- ${dtps.unstable ? `
- <div id="dtpsUnstable" class="navitem">
- <i style="font-size: 16px;" class="material-icons">warning</i>
- <span style="font-weight: bold; font-size: 10px;">THIS IS AN UNSTABLE VERSION OF POWER+. USE AT YOUR OWN RISK.</span>
- </div>
- ` : ""}
-
- <div class="items" style="position: fixed; left: calc(50% - 250px); margin: 0px;">
- <i class="inputIcon material-icons">search</i>
- <input id="dtpsMainSearchBox" style="margin: 0px; width: 500px;" type="search" class="inputIcon filled" placeholder="Search" />
- </div>
-
- <div class="profile">
- <div class="profileImage"></div>
- </div>
- </div>
-
- <div class="card close focus profileMenu">
- <div class="person">
- <div class="profileImage"></div>
- <div class="info">
- <h5 class="name">Logged out</h5>
- </div>
- </div>
-
- <div class="actions">
- <div class="item">
- <i class="material-icons">feedback</i>
- <span class="label">Feedback</span>
- </div>
- ${dtps.remoteConfig.showBugReportButton || dtps.unstable || (dtps.env == "dev") ? /*html*/`
- <div class="item">
- <i class="material-icons">bug_report</i>
- <span class="label">Bug Report</span>
- </div>
- ` : ""}
- <div onclick="dtps.settings();" class="item">
- <i class="material-icons">settings</i>
- <span class="label">Settings</span>
- </div>
- <div class="divider"></div>
- <a style="color: var(--text);" href="/">
- <div class="item">
- <i class="material-icons">exit_to_app</i>
- <span class="label">Go to Canvas</span>
- </div>
- </a>
- </div>
- </div>
-
- <div id="dtpsSearchResults" class="card acrylicMaterial" style="display: none;">
- <h5 id="dtpsSearchStatus"><i class="material-icons">search</i> <span>Search</span></h5>
- <div id="dtpsSearchData" style="display: none;"></div>
- <div id="dtpsSearchInfo">
- <p>By defualt, Power+ will search based on the page you're on. You can use the keywords below for more advanced searches:</p>
- <div class="grid samesize">
- <div class="item">
- <p><i class="material-icons">library_books</i> type:coursework</p>
- <p><i class="material-icons">view_module</i> type:module</p>
- <p><i class="material-icons">assignment</i> type:assignment</p>
- <p><i class="material-icons">assessment</i> type:grade</p>
- <p><i class="material-icons">announcement</i> type:announcement</p>
- </div>
- <div class="item">
- <p><i class="material-icons">home</i> type:homepage</p>
- <p><i class="material-icons">insert_drive_file</i> type:page</p>
- <p><i class="material-icons">forum</i> type:discussion</p>
- <p><i class="material-icons">people</i> type:person</p>
- <div class="divider"></div>
- <p><i class="material-icons">class</i> class:English</p>
- </div>
- </div>
- </div>
- </div>
-
- <div class="headerArea classImage">
- <img style="display: none;" />
- <div class="content">
- <h1 id="headText"><i class="material-icons">dashboard</i> <span>Dashboard</span></h1>
- <div id="classInfo" style="min-height: 18px;">
- <p class="teacher" style="display: none;">
- <span class="teacherImage"></span> <span class="teacherName"></span>
- </p>
- <p onclick="dtps.classHome(dtps.selectedClass);" class="homepage" style="cursor: pointer; display: none;">
- <i class="material-icons">home</i> <span>Homepage</span>
- </p>
- <p class="videoMeeting" style="cursor: pointer; display: none;">
- <i class="material-icons">videocam</i> <span>Meeting</span>
- </p>
- <p class="contentLabel" style="display: none;">
- <i class="material-icons"></i> <span></span>
- </p>
- </div>
- <div style="display: none;" id="dtpsTabBar" class="btns">
- <button init="true" onclick="if (dtps.classes[dtps.selectedClass].modules && (window.localStorage.getItem('courseworkPref-' + dtps.classes[dtps.selectedClass].id) == 'moduleStream')) { fluid.screen('moduleStream', dtps.classes[dtps.selectedClass].id); } else { fluid.screen('stream', dtps.classes[dtps.selectedClass].id); }" class="btn stream">
- <i class="material-icons">library_books</i>
- Coursework
- </button>
- <button init="true" onclick="fluid.screen('people', dtps.classes[dtps.selectedClass].id);" class="btn people">
- <i class="material-icons">people</i>
- People
- </button>
- <button init="true" onclick="fluid.screen('discussions', dtps.classes[dtps.selectedClass].id);" class="btn discuss">
- <i class="material-icons">forum</i>
- Discussions
- </button>
- <button init="true" onclick="fluid.screen('pages', dtps.classes[dtps.selectedClass].id);" class="btn pages">
- <i class="material-icons">insert_drive_file</i>
- Pages
- </button>
- <button init="true" onclick="fluid.screen('gradebook', dtps.classes[dtps.selectedClass].id);" class="btn grades">
- <i class="material-icons">assessment</i>
- ${dtpsLMS.gradebook ? "Grades" : "Gradebook"}
- </button>
- </div>
- </div>
- </div>
-
- <!-- Class content area -->
- <div class="classContent">
- <div class="spinner"></div>
- </div>
-
- <!-- Settings card (its inner HTML is added later) -->
- <div style="height: 100%; overflow: auto !important;" class="card withnav focus close container settingsCard"></div>
-
- <!-- Changelog card -->
- <div style="border-radius: 30px;" class="card focus changelog close container">
- <i onclick="fluid.cards.close('.card.changelog')" class="material-icons close">close</i>
- <h3>What's new in Power+</h3>
- <h5>Loading...</h5>
- </div>
-
- <!-- General details card for assignments, outcomes, class info, etc. -->
- <div style="border-radius: 30px;" class="card focus details close container">
- <i onclick="fluid.cards.close('.card.details')" class="material-icons close">close</i>
- <p>An error occured</p>
- </div>
-
- <!-- General iFrame card (with white background) -->
- <div style="border-radius: 30px; top: 50px; background-color: white; color: black;" class="card focus close iFrameCard container">
- <i style="color: black !important;" onclick="fluid.cards.close('.card.iFrameCard'); $('#CardIFrame').attr('src', '');" class="material-icons close">close</i>
- <br /><br />
- <iframe style="width: 100%; height: calc(100vh - 175px); border: none;" id="CardIFrame"></iframe>
- </div>
- `);
-
- $("#dtpsMainSearchBox").on("focus", function () {
- $("#dtpsSearchResults").show();
- });
-
- $("#dtpsMainSearchBox").on("blur", function () {
- $("#dtpsSearchResults").hide();
- });
-
- $("#dtpsMainSearchBox").on("input", function () {
- dtps.setSearchBox();
- });
-
- $(document).on("keydown", "#dtpsMainSearchBox", function (e) {
- if (e.key == "Enter") {
- //Validate input and tags
- var term = $("#dtpsMainSearchBox").val().replace(/(type|class):[a-z]*/gi, "").trim();
- if ($("#dtpsMainSearchBox").attr("data-search-type") && $("#dtpsMainSearchBox").attr("data-dtps-course")) {
- fluid.screen("search", term);
- $("#dtpsMainSearchBox").blur();
- }
- }
- });
-}
-
-/**
- * Sets the search box text based on the current page or keywords
- */
-dtps.setSearchBox = function () {
- var value = $("#dtpsMainSearchBox").val() || "";
-
- var type = null;
- var course = dtps.selectedClass == "dash" ? "dash" : dtps.classes[dtps.selectedClass];
- var icon = null;
- var error = false;
- var autoType = null;
- var autoCourse = dtps.selectedClass == "dash" ? "dash" : dtps.classes[dtps.selectedClass];
-
- //Get automatic type from selected content
- if (dtps.selectedContent == "people") type = "people";
- if (dtps.selectedContent == "discuss") type = "discussions";
- if (dtps.selectedContent == "pages") type = "pages";
- if (dtps.selectedContent == "grades") type = "grades";
- if ((dtps.selectedClass == "dash") || (dtps.selectedContent == "stream") || (dtps.selectedContent == "moduleStream")) type = "coursework";
- autoType = type;
-
- //Reuse auto type if on search
- if (dtps.selectedClass == "search") {
- type = $("#dtpsMainSearchBox").attr("data-ctx-type");
- course = $("#dtpsMainSearchBox").attr("data-ctx-course");
- if (!isNaN(Number(course))) course = dtps.classes[course];
- }
-
- //Check for type override from search box
- if (value.split(" ").includes("type:coursework")) type = "coursework";
- if (value.split(" ").includes("type:homepage")) type = "homepages";
- if (value.split(" ").includes("type:page")) type = "pages";
- if (value.split(" ").includes("type:discussion")) type = "discussions";
- if (value.split(" ").includes("type:grade")) type = "grades";
- if (value.split(" ").includes("type:person")) type = "people";
- if (value.split(" ").includes("type:assignment")) type = "assignments";
- if (value.split(" ").includes("type:module")) type = "modules";
- if (value.split(" ").includes("type:announcement")) type = "announcements";
- if (value.split(" ").includes("type:all")) type = "everything";
-
- //Get icon from final type
- if (type == "coursework") icon = "library_books";
- if (type == "people") icon = "people";
- if (type == "discussions") icon = "forum";
- if (type == "pages") icon = "insert_drive_file";
- if (type == "grades") icon = "assessment";
- if (type == "assignments") icon = "assignment";
- if (type == "modules") icon = "view_module";
- if (type == "homepages") icon = "home";
- if (type == "announcements") icon = "announcement";
- if (type == "everything") icon = "warning";
-
- //Check for course override from search box
- if (value.includes("class:")) {
- var partialSubject = value.split("class:")[1].split(" ")[0].toLowerCase();
- if (partialSubject == "all") {
- course = "all";
- } else if (partialSubject) {
- dtps.classes.forEach(c => {
- if (c.subject.toLowerCase().includes(partialSubject)) {
- course = c;
- }
- });
- }
- }
-
- //Check if the course supports the type
- if ((course !== "dash") && (course !== "all")) {
- if ((type == "pages") && !course.pages) error = true;
- if ((type == "discussions") && !course.discussions) error = true;
- if ((type == "modules") && !course.modules) error = true;
- if ((type == "homepages") && !course.homepage) error = true;
- if ((type == "people") && !course.people) error = true;
- }
-
- if ((course == "dash") || (course == "all")) {
- $("#dtpsSearchStatus i").text(icon);
- $("#dtpsSearchStatus span").text("Search " + (type == "everything" ? type : "all " + type));
- $("#dtpsMainSearchBox").attr("placeholder", "Search " + (type == "everything" ? type : "all " + type));
- $("#dtpsMainSearchBox").attr("data-dtps-course", "all");
- $("#dtpsMainSearchBox").attr("data-search-type", type);
- } else if (error) {
- $("#dtpsSearchStatus i").text("error");
- $("#dtpsSearchStatus span").html(`Cannot search for ${type} in <b style="color: ${course.color};">${course.subject}</b>`);
- $("#dtpsMainSearchBox").attr("placeholder", "Cannot search for " + type + " in " + course.subject);
- $("#dtpsMainSearchBox").attr("data-dtps-course", "");
- $("#dtpsMainSearchBox").attr("data-search-type", "");
- } else if (course || true) {
- $("#dtpsSearchStatus i").text(icon);
- $("#dtpsSearchStatus span").html(`Search ${type} in <b style="color: ${course.color};">${course.subject}</b>`);
- $("#dtpsMainSearchBox").attr("placeholder", "Search " + type + " in " + course.subject);
- $("#dtpsMainSearchBox").attr("data-dtps-course", course.num);
- $("#dtpsMainSearchBox").attr("data-search-type", type);
- }
-
- //Set auto type
- if (dtps.selectedClass !== "search") {
- $("#dtpsMainSearchBox").attr("data-ctx-type", autoType);
- $("#dtpsMainSearchBox").attr("data-ctx-course", autoCourse == "dash" ? "dash" : autoCourse.num);
- }
-}
-
-/**
- * Renders basic content after the user has been loaded
- */
-dtps.renderLite = function () {
- //Add hideGrades body class if enabled and preference listener
- if (fluid.get("pref-hideGrades") == "true") { jQuery('body').addClass('hidegrades'); }
- document.addEventListener("pref-hideGrades", function (e) {
- if ((e.detail == "true") || (e.detail == true)) {
- //hideGrades has been enabled, add class to body to hide grades via CSS
- jQuery('body').addClass('hidegrades');
- } else {
- //hideGrades has been disabled, remove class from body to show grades
- jQuery('body').removeClass('hidegrades');
- }
- });
-
- //Render settings card
- var baseHost = new URL(dtps.baseURL).hostname;
- jQuery(".card.settingsCard").html(/*html*/`
- <i onclick="fluid.cards.close('.card.settingsCard')" class="material-icons close">close</i>
-
- <div style="position: fixed; height: calc(100% - 100px);" class="sidenav">
- <div class="title">
- <img src="${dtps.baseURL + "/icon.svg"}" style="width: 50px;vertical-align: middle;padding: 7px; padding-top: 14px;" />
- <div style="vertical-align: middle; display: inline-block;">
- <h5 style="font-weight: bold;display: inline-block;vertical-align: middle;">Power+</h5>
- <p>${dtps.readableVer + (dtps.unstable ? ` <span style="font-size: 12px; color: red;">(unstable)</span>` : "")}</p>
- </div>
- </div>
-
- <div onclick="$('.abtpage').hide();$('.abtpage.settings').show();" class="item active">
- <i class="material-icons">settings</i> Settings
- </div>
- ${dtps.remoteConfig.showGradesInSettings ? /*html*/`
- <div onclick="$('.abtpage').hide();$('.abtpage.grades').show();" class="item">
- <i class="material-icons">assessment</i> Grades
- </div>
- ` : ``}
- <div onclick="$('.abtpage').hide();$('.abtpage.dashboard').show();" class="item">
- <i class="material-icons">dashboard</i> Dashboard
- </div>
- ${dtps.env == "dev" ? /*html*/`
- <div onclick="$('.abtpage').hide();$('.abtpage.debugging').show();" class="item">
- <i class="material-icons">bug_report</i> Debugging
- </div>
- <div onclick="$('.abtpage').hide();$('.abtpage.experiments').show();" class="item">
- <i class="material-icons">science</i> Experiments
- </div>
- ` : ``}
- <div onclick="$('.abtpage').hide();$('.abtpage.about').show();" class="item abt">
- <i class="material-icons">info</i> About
- </div>
- </div>
-
- <div style="min-height: 100%" class="content">
- <div class="abtpage settings">
- <h5><b>Settings</b></h5>
-
- <br />
- <p>Theme</p>
-
- <div>
- <div class="btns row themeSelector"></div>
-
- <br /><br />
- <p>Grades</p>
-
- <div onclick="fluid.set('pref-hideGrades');" class="switch pref-hideGrades"><span class="head"></span></div>
- <div class="label"><i class="material-icons">visibility_off</i> Hide class grades</div>
- </div>
-
- <br /><br />
- <p>Classes</p>
- <p style="display: none;" id="settingsReloadWarning">You must reload for the changes you've made to take effect</p>
-
- <div>
- <div onclick="fluid.set('pref-fullNames'); dtps.settingsReloadWarning();" class="switch pref-fullNames"><span class="head"></span></div>
- <div class="label"><i class="material-icons">title</i> Show full class names</div>
-
- <br /><br />
- <div onclick="fluid.set('pref-hideClassImages')" class="switch pref-hideClassImages"><span class="head"></span></div>
- <div class="label"><i class="material-icons">image</i> Hide class images</div>
-
- ${dtpsLMS.dtech && !dtps.user.parent ? /*html*/`
- <br /><br />
- <div onclick="fluid.set('pref-autoGroupClasses'); dtps.settingsReloadWarning();" class="switch pref-autoGroupClasses active"><span class="head"></span></div>
- <div class="label"><i class="material-icons">sort</i> Automatically group and sort classes</div>
- <br /><br />
- <div onclick="fluid.set('pref-formatAssignmentContent');" class="switch pref-formatAssignmentContent active"><span class="head"></span></div>
- <div class="label"><i class="material-icons">format_paint</i> Reformat assignment content</div>
- ` : ""
- }
-
- </div>
-
- <div id="dtpsPrereleaseTesting" style="${window.localStorage.prereleaseEnabled || (dtps.env == "dev") || window.localStorage.githubRepo || window.localStorage.externalReleaseURL ? "" : "display: none;"}">
- <br /><br />
- <p>Prerelease testing</p>
-
- <div>
- <div class="btns row small">
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'prod')"
- class="btn ${!["dev", "github", "external", "local"].includes(window.localStorage.dtpsLoaderPref) ? "active" : ""}">
- <i class="material-icons">label</i> Production
- </button>
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'dev')"
- class="btn ${window.localStorage.dtpsLoaderPref == "dev" ? "active" : ""}">
- <i class="material-icons">feedback</i> Dev
- </button>
- ${window.localStorage.githubRepo ? /*html*/`
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'github')"
- class="btn ${window.localStorage.dtpsLoaderPref == "github" ? "active" : ""}">
- <i class="material-icons">account_tree</i> Branch
- </button>
- ` : ``}
- ${window.localStorage.externalReleaseURL ? /*html*/`
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'external')"
- class="btn ${window.localStorage.dtpsLoaderPref == "external" ? "active" : ""}">
- <i class="material-icons">public</i> External
- </button>
- ` : ``}
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'local')"
- class="btn ${window.localStorage.dtpsLoaderPref == "local" ? "active" : ""}">
- <i class="material-icons">developer_board</i> Local
- </button>
- </div>
- </div>
- </div>
-
- </div>
-
- <div style="display: none;" class="abtpage grades">
- <h5><b>Grades</b></h5>
-
- <br />
-
- <div>
- <h6>Estimated GPA: <b id="dtpsGpaText">...</b></h6>
- <p style="color: var(--secText);"><i>This GPA calculation is unofficial and does not account for honors credit</i></p>
- </div>
-
- <br />
-
- <div id="classGradeBars"></div>
- </div>
-
- <div style="display: none;" class="abtpage dashboard">
- <h5><b>Dashboard</b></h5>
- <p>You can rearrange the items shown on the dashboard by dragging them below. You might have to reload Power+ for changes to take effect.</p>
-
- <button onclick="dtps.resetDashboardPrefs();" class="btn small"><i class="material-icons">refresh</i> Reset dashboard layout</button>
-
- <br />
-
- <div id="leftDashboardColumn" class="dashboardColumn"></div>
-
- <div id="rightDashboardColumn" class="dashboardColumn"></div>
- </div>
-
- ${dtps.env == "dev" ? /*html*/`
- <div style="display: none;" class="abtpage debugging">
- <h5><b>Debugging</b></h5>
- <p>These settings are for development only and might break Power+. Use at your own risk.</p>
-
- <div>
- <button onclick="dtps.firstrun()" class="btn small"><i class="material-icons">web_asset</i> Show firstrun screen</button>
- </div>
-
- <br /><br />
-
- <h5>Release configuration</h5>
-
- <button onclick="['dtpsLoaderPref', 'prereleaseEnabled', 'githubRepo', 'externalReleaseURL', 'dtpsLMSOverride'].forEach(k => window.localStorage.removeItem(k)); window.location.reload();" class="btn small"><i class="material-icons">cancel</i> Clear release configurations</button>
- <br /><br />
-
- <div>
- <input id="dtpsGithubRepo" value="${window.localStorage.githubRepo || ""}" placeholder="Branch GitHub repo" />
- <button class="btn small" onclick="window.localStorage.setItem('githubRepo', $('#dtpsGithubRepo').val())"><i class="material-icons">save</i> Save</button>
- </div>
-
- <div>
- <input id="dtpsExternalReleaseURL" value="${window.localStorage.externalReleaseURL || ""}" placeholder="External release URL" />
- <button class="btn small" onclick="window.localStorage.setItem('externalReleaseURL', $('#dtpsExternalReleaseURL').val())"><i class="material-icons">save</i> Save</button>
- </div>
-
- <div>
- <input id="dtpsLMSOverride" value="${window.localStorage.dtpsLMSOverride || ""}" placeholder="LMS override" />
- <button class="btn small" onclick="window.localStorage.setItem('dtpsLMSOverride', $('#dtpsLMSOverride').val())"><i class="material-icons">save</i> Save</button>
- </div>
-
- <br />
-
- <h5>Behavior Overrides</h5>
-
- <br />
- <div onclick="fluid.set('pref-debuggingGenericGradebook')" class="switch pref-debuggingGenericGradebook"><span class="head"></span></div>
- <div class="label">Always use the generic gradebook</div>
- </div>
- <div style="display: none;" class="abtpage experiments">
- <h5><b>Experiments</b></h5>
- <p>These settings control how Power+ behaves. Changing these settings may enabled unsupported and/or unfinished features that can break Power+. Use at your own risk.</p>
-
- <button onclick="Object.keys(dtps.remoteConfig).forEach(k => window.localStorage.removeItem('dtpsRemoteConfig-' + k));" class="btn small"><i class="material-icons">cancel</i> Clear Overrides</button>
- <br /><br />
- ${Object.keys(dtps.remoteConfig).map(k => (`
- <div>
- <p>${k} ${window.localStorage.getItem("dtpsRemoteConfig-" + k) ? " <b>(overridden)</b>" : ""}</p>
- <input value="${dtps.remoteConfig[k]}" placeholder="Value" />
- <button class="btn small" onclick="window.localStorage.setItem('dtpsRemoteConfig-${k}', $(this).siblings('input').val())"><i class="material-icons">save</i> Save</button>
- </div>
- `)).join("")}
- </div>
- ` : ``}
-
- <div style="display: none;" class="abtpage about">
- <h5><b>About</b></h5>
-
- <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
- <img src="${dtps.baseURL + "/icon.svg"}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px;" />
-
- <div style="display: inline-block; vertical-align: middle;">
- <h4 id="dtpsAboutName" onclick="dtps.classicEntry()" style="font-weight: bold; font-size: 32px; margin-bottom: 0px; user-select: none;">${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
- <div style="font-size: 16px; margin-top: 5px;">
- ${dtps.readableVer}
- <div style="display: inline-block;margin: 0px 5px;font-size: 12px;">${baseHost !== "powerplus.app" ? `(from ${baseHost})` : ""}</div>
- </div>
- </div>
-
- <div style="margin-top: 15px; margin-bottom: 7px;"><a onclick="dtps.changelog();" style="color: var(--lightText); margin: 0px 5px;" href="#"><i class="material-icons" style="vertical-align: middle">update</i> Changelog</a>
- <a onclick="if (window.confirm('Are you sure you want to uninstall Power+? The extension will be removed and all of your Power+ data will be erased. If you use the Power+ bookmarklet, you will have to remove that yourself.')) { document.dispatchEvent(new CustomEvent('extensionData', { detail: 'extensionUninstall' })); window.localStorage.clear(); window.alert('Power+ has been uninstalled. Reload the page to go back to ${dtpsLMS.shortName}.') }" style="color: var(--lightText); margin: 0px 5px; cursor: pointer;"><i class="material-icons" style="vertical-align: middle">delete_outline</i> Uninstall</a>
- <a style="color: var(--lightText); margin: 0px 5px;" href="mailto:[email protected]"><i class="material-icons" style="vertical-align: middle">email</i> Contact</a>
- </div>
- </div>
-
- <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
- <div style="margin-top: 12px;">
- <img src="${dtps.user.photoURL}" style="height: 50px; margin-right: 10px; vertical-align: middle; border-radius: 50%;" />
-
- <div style="display: inline-block; vertical-align: middle;">
- <h4 style="font-weight: bold; font-size: 32px; margin: 0px;">${dtps.user.name} <span style="font-size: 12px; line-height: 0px;">${dtps.user.id}</span></h4>
- </div>
- </div>
-
- <div style="margin-top: 15px; margin-bottom: 7px;">
- <a style="color: var(--lightText); margin: 0px 5px;" href="/logout"><i class="material-icons" style="vertical-align: middle">exit_to_app</i> Logout</a>
- </div>
- </div>
-
- <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
- <img src="${dtpsLMS.logo}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px; border-radius: 50%; background: #ee5034;" />
-
- <div style="display: inline-block; vertical-align: middle;">
- <h4 style="font-weight: bold; font-size: 32px; margin-bottom: 0px;">${dtpsLMS.name}</h4>
- ${dtpsLMS.description ? `
- <div style="font-size: 16px; margin-top: 5px;">${dtpsLMS.description}</div>
- ` : ``}
- </div>
-
- <div style="margin-top: 15px; margin-bottom: 7px;">
- <a style="color: var(--lightText); margin: 0px 5px;" href="${dtpsLMS.source}"><i class="material-icons" style="vertical-align: middle">code</i> LMS integration source code</a>
- </div>
- </div>
-
- <div class="card advancedOptions" style="padding: 8px 16px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px; ${dtps.env == "dev" ? `` : `display: none;`}">
- <div style="display: inline-block; vertical-align: middle;">
- <h4 style="font-weight: bold; font-size: 28px; margin-bottom: 0px;">Advanced Options</h4>
- </div>
-
- <div style="margin-top: 15px; margin-bottom: 7px;">
- <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="dtps.clearData();"><i class="material-icons" style="vertical-align: middle">refresh</i> Reset Power+</a>
- <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="if (confirm('Prerelease versions of Power+ are often untested and can break or display incorrect information. Are you sure you want to continue?')) {window.localStorage.prereleaseEnabled = 'true'; $('#dtpsPrereleaseTesting').show(); alert('Prerelease versions can be enabled by going to Settings -> Prerelease testing');}"><i class="material-icons" style="vertical-align: middle">feedback</i> Test prerelease versions</a>
- </div>
- </div>
-
- <br />
- ${dtps.env == "dev" ? `` : `<p style="cursor: pointer; color: var(--secText, gray)" onclick="$('.advancedOptions').show(); $(this).hide();" class="advOp">Show advanced options</p>`}
-
- <div style="text-align: center; padding: 50px 0px;">
- <img style="height: 45px; margin-right: 20px; vertical-align: middle;" src="https://cdn.jottocraft.com/images/footerImage.png" />
- <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
- <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
- </div>
- </div>
- </div>
- `);
-
- //Set profile image
- jQuery(".profileImage").css("background-image", "url('" + dtps.user.photoURL + "')");
- jQuery(".profileMenu .name").text(dtps.user.name);
-
- //Load Fluid UI
- fluid.onLoad();
-
- //Render sidebar
- dtps.showClasses();
-
- //Remove loading screen styles
- jQuery("#dtpsNativeOverlay style").remove();
-
- //Fade out loading screen
- jQuery("#dtpsNativeOverlay").css("opacity", "0");
-
- //Remove loading screen after the animation is complete
- setTimeout(() => jQuery("#dtpsNativeOverlay").remove(), 200);
-}
-
-//Start loading DTPS
-dtps.init();
-
-//LMS Integration documentation -------------------------------------------------------------------------------------
-
-/**
- * @namespace dtpsLMS
- * @description Global DTPS LMS integration object. All LMS-related tasks, such as fetching data, are handled by this object. This is always loaded first.
- * @global
- * @property {string} name Full LMS name
- * @property {string} [shortName] Short LMS name
- * @property {string} legalName Legal name (or names) to show in the "Welcome to Power+" disclaimer
- * @property {string} [description] A short description of the LMS integration provided
- * @property {string} logo LMS logo image URL
- * @property {string} url URL to the LMS' website
- * @property {string} source URL to the LMS integration's source code
- * @property {boolean} [dtech] True if this LMS is d.tech
- * @property {boolean} [institutionSpecific] True if the LMS is designed for a specific institution instead of a broader LMS
- * @property {boolean} [preferRubricGrades] True if DTPS should prefer rubric grades for assignments
- * @property {boolean} [genericGradebook] True if DTPS should show the generic gradebook. Ignored if dtpsLMS.gradebook defined.
- */
-
-/**
- * @name dtpsLMS.fetchUser
- * @description [REQUIRED] Fetches data for the current user from the LMS. If the user is not signed in, reject with an object that looks like {action: "login", redirectURL: "..."} to login the user.
- * @kind function
- * @return {Promise<User>} A promise which resolves to a User object
- */
-
-/**
-* @name dtpsLMS.fetchClasses
-* @description [REQUIRED] Fetches class data from the LMS
-* @kind function
-* @param {string} userID The user ID to fetch classes for
-* @return {Promise<Class[]>} A promise which resolves to an array of Class objects
-*/
-
-/**
-* @name dtpsLMS.fetchAssignments
-* @description [REQUIRED] Fetches assignment data for a course from the LMS
-* @kind function
-* @param {string} userID The user ID to fetch assignments for
-* @param {string} classID The class ID to fetch assignments for
-* @return {Promise<Assignment[]>} A promise which resolves to an array of Assignment objects
-*/
-
-/**
-* @name dtpsLMS.fetchModules
-* @description [OPTIONAL] Fetches module data for a course from the LMS
-* @kind function
-* @param {string} userID The user ID to fetch modules for
-* @param {string} classID The class ID to fetch modules for
-* @return {Promise<Module[]>} A promise which resolves to an array of Module objects
-*/
-
-/**
-* @name dtpsLMS.collapseModule
-* @description [OPTIONAL] Collapses a module in the LMS
-* @kind function
-* @param {string} classID The ID of the class
-* @param {string} moduleID The ID of the module to collapse
-* @param {boolean} collapsed True if the module is collapsed, false otherwise
-* @return {Promise} A promise which resolves when the operation is completed
-*/
-
-/**
-* @name dtpsLMS.collapseAllModules
-* @description [OPTIONAL] Collapses all modules in the LMS
-* @kind function
-* @param {string} classID The ID of the class
-* @param {boolean} collapsed True if all modules should be collapsed, false otherwise
-* @return {Promise} A promise which resolves when the operation is completed
-*/
-
-/**
-* @name dtpsLMS.fetchAnnouncements
-* @description [OPTIONAL] Fetches recent announcements for a course from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch announcements for
-* @return {Promise<Announcement[]>} A promise which resolves to an array of Announcement objects
-*/
-
-/**
-* @name dtpsLMS.fetchMeetingURL
-* @description [OPTIONAL] Fetches the videoMeetingURL for a class
-* @kind function
-* @param {string} classID The class ID to get the videoMeetingURL for
-* @return {Promise<string>} A promise which resolves to the videoMeetingURL for the class, or null if the class does not have a videoMeetingURL
-*/
-
-/**
-* @name dtpsLMS.fetchHomepage
-* @description [OPTIONAL] Fetches homepage HTML for a course from the LMS
-* @kind function
-* @param {string} classID The class ID to get the homepage for
-* @return {Promise<string>} A promise which resolves to the HTML for the class homepage
-*/
-
-/**
-* @name dtpsLMS.fetchUsers
-* @description [OPTIONAL] Fetches the users for a course from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch users for
-* @return {Promise<ClassSection[]>} A promise which resolves to an array of sections in this class
-*/
-
-/**
-* @name dtpsLMS.fetchDiscussionThreads
-* @description [OPTIONAL] Fetches discussion threads for a course from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch discussion threads for
-* @return {Promise<PartialDiscussionThread[]>} A promise which resolves to an array of partial Discussion Thread objects
-*/
-
-/**
-* @name dtpsLMS.fetchDiscussionPosts
-* @description [REQUIRED IF dtpsLMS.fetchDiscussionThreads IS IMPLEMENTED] Fetches discussion posts in a thread from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch discussion posts for
-* @param {string} threadID The discussion thread ID to fetch discussion posts for
-* @return {Promise<DiscussionThread>} A promise which resolves to a full discussion thread object
-*/
-
-/**
-* @name dtpsLMS.fetchPages
-* @description [OPTIONAL] Fetches pages for a course from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch pages for
-* @return {Promise<PartialPage[]>} A promise which resolves to an array of partial page objects
-*/
-
-/**
-* @name dtpsLMS.fetchPageContent
-* @description [REQUIRED IF dtpsLMS.fetchPages IS IMPLEMENTED] Fetches content for a page from the LMS
-* @kind function
-* @param {string} classID The class ID to fetch page content for
-* @param {string} pageID The page ID to fetch page content for
-* @return {Promise<Page>} A promise which resolves to a full DTPS page object
-*/
-
-/**
-* @name dtpsLMS.gradebook
-* @description [OPTIONAL] Renders custom gradebook HTML for unique grading systems or for a more tailored experience. The gradebook only shows for classes with a grade and with at least 1 assignment.
-* @kind function
-* @param {Class} course Class to render the gradebook for. If custom grade calculation is enabled (dtpsLMS.calculateGrade), those results can be accessed at course.gradeCalculation.
-* @return {Promise<string>} A promise which resolves to HTML to render for the class gradebook
-*/
-
-/**
-* @name dtpsLMS.gradebookDidRender
-* @description [OPTIONAL] Called after the HTML returned by dtpsLMS.gradebook has rendered. Runs any initialization needed for the gradebook, such as enabling interactive elements or what-if grades.
-* @kind function
-* @param {Class} course Class the gradebook was rendered for
-*/
-
-/**
-* @name dtpsLMS.calculateGrade
-* @description [OPTIONAL] Calculates class grades with a custom grade calculation formula. Used for unique grading systems.
-* @kind function
-* @param {Class} course Class to calculate grades for [DO NOT USE COURSE.ASSIGNMENTS to access assignments for grade calculation. Use the assignments parameter instead.]
-* @param {Assignment[]} assignments Assignments used for grade calculation. Use this instead of course.assignments for hypothetical/what-if grade calculation.
-* @return {undefined|object} The letter grade should be returned in the "letter" property as a string and the percentage in the "grade" property as a number. Other custom properties can be set if they need to be accessed by dtpsLMS.gradebook. Return undefined if there is no grade for the class.
-*/
-
-/**
-* @name dtpsLMS.isUsualDueDate
-* @description [OPTIONAL, INSTITUTION ONLY] This function returns true if the due date provided is usual/expected and false if the due date is unusual/expected. If the due date is unusual, it is shown in bold in the UI. For institutions where there is a pattern/standard for due dates between classes.
-* @kind function
-* @param {Date} date The due date to check
-* @return {boolean} True if the due date is usual, false if the due date is unusual/unexpected.
-*/
-
-/**
-* @name dtpsLMS.updateAssignments
-* @description [OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override assignment data returned by the LMS.
-* @kind function
-* @param {Assignment[]} assignments Original assignments array
-* @return {Promise<Assignment[]>} A promise that resolves to the updated assignments array
-*/
-
-/**
-* @name dtpsLMS.updateClasses
-* @description [OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override class data returned by the LMS.
-* @kind function
-* @param {Class[]} classes Original classes array
-* @return {Promise<Class[]>} A promise that resolves to the updated classes array
-*/
-
-//Type definitions -------------------------------------------------------------------------------------
-
-/**
- * @typedef {string|Date} Date
- * @description A date string recognized by {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse|Date.parse} or an actual {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date|Date} object
- */
-
-/**
- * @typedef {Object} User
- * @description Defines user objects in DTPS
- * @property {string} name User name
- * @property {string} id User ID
- * @property {string} photoURL User photo URL
- * @property {string} url [ONLY FOR DTPSLMS.FETCHUSERS] The URL to this user's profile. Only used when displaying users in the people tab.
- * @property {User[]} [children] [ONLY FOR DTPS.USER] Array of child users. If this is defined, the user is treated as a parent account. Sub-children are not allowed.
- * @property {boolean} parent [ONLY FOR DTPS.USER] Automatically managed by DTPS. True if the user is a parent account.
- */
-
-/**
-* @typedef {Object} Class
-* @description Defines class objects in DTPS
-* @property {string} name Name of the class
-* @property {string} id Class ID used by Power+
-* @property {string} lmsID Class ID used for LMS API calls
-* @property {string} userID The ID of the user this class is associated with (from the parameter of dtpsLMS.fetchClasses)
-* @property {number} num Index of the class in the dtps.classes array
-* @property {string} subject Class subject
-* @property {ClassSection[]|boolean} [people] Users in this class. True if the class supports the "People" tab, but not yet loaded. If this is true dtpsLMS.fetchUsers must be implemented.
-* @property {string} [icon] The icon to show with this class
-* @property {string} [group] The name of the group that this class is in
-* @property {number|string} [period] The period or section the user has this class at
-* @property {Date} [endDate] The end date for this course
-* @property {Assignment[]} assignments Class assignments. Assume assignments are still loading if this is undefined. The class has no assignments if this is an empty array. Loaded in dtps.init.
-* @property {Module[]|boolean} [modules] Class modules. Assume this class supports the modules feature, but is not yet loaded, if this is true and that the class has no modules if this is an empty array. For LMSs that do not support modules, either keep it undefined or set it to false.
-* @property {DiscussionThread[]|boolean} [discussions] Class discussion threads. Assume this class supports discussions, but not yet loaded, if this is true and that the class has no threads if this is an empty array. For LMSs that do not support discussions, either keep it undefined or set it to false.
-* @property {Page[]|boolean} [pages] Class pages. Assume this class supports the pages feature, but not yet loaded, if true and that the class has no pages if this is an empty array. For LMSs that do not support pages, either keep it undefined or set it to false.
-* @property {string} [newDiscussionThreadURL] A URL the user can visit to create a new discussion thread in this class
-* @property {boolean} [homepage] True if the class has a homepage. If a class has a homepage, dtpsLMS.fetchHomepage must be implemented.
-* @property {string} [term] Class term
-* @property {string} [color] Class color
-* @property {number} [grade] Current percentage grade in the class
-* @property {string} [letter] Current letter grade in the class
-* @property {string} [previousLetter] Automatically managed by DTPS. The previous letter grade in this class, based on local grade history.
-* @property {string} [image] URL to the class background image
-* @property {User} [teacher] Class teacher. If the class has multiple teachers, this is the primary teacher.
-* @property {boolean} [hasGradebook] Automatically managed by DTPS. True if the class should show the gradebook tab.
-* @property {object} [gradeCalculation] Automatically managed by DTPS. If custom grade calculation is implemented, this will be the results from custom grade calculation returned by dtpsLMS.calculateGrade.
-* @property {string} [videoMeetingURL] The URL used to join this class' online meeting. If dtpsLMS.fetchMeetingURL is implemented, DTPS will use it to get the meeting URL if this property is undefined. If this property is null, DTPS will not call dtpsLMS.fetchMeeting URL for the class.
-*/
+/**
+ * @file DTPS Core functions and module loader
+ * @author jottocraft
+ * @version v3.1.0
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+//Make sure DTPS isn't already loading
+if (typeof dtps !== "undefined") throw "Error: DTPS is already loading";
+
+/**
+ * Global DTPS object
+ * All global DTPS functions and variables are stored in this object
+ *
+ * @global
+ * @namespace dtps
+ * @property {number} ver Comparable version number
+ * @property {string} env DTPS enviornment ("prod" or "dev")
+ * @property {string} readableVer Formatted semantic version number
+ * @property {Class[]} classes Array of classes the current user is in
+ * @property {string} baseURL The base URL that DTPS is being loaded from
+ * @property {boolean} unstable This is true if loading an unstable version of DTPS
+ * @property {boolean} gradebookExpanded True if gradebook details (Show more...) is open. Used in the generic gradebook and may be used in custom gradebook implementations.
+ * @property {string|undefined} popup Popup to show when loaded. Either undefined (no popup), "firstrun", or "changelog".
+ * @property {User} user Current user, fetched with dtps.init
+ * @property {number|string} selectedClass The selected class number, or "dash" if the dashboard is selected. Set when the first screen is loaded in dtps.init.
+ * @property {string} selectedContent The selected class content/tab. Set when the first class content is loaded. Defaults to "stream".
+ * @property {number|undefined} bgTimeout Background transition timeout when switching between classes
+ * @property {Array<Assignment|Announcement>} updates Array of up to 10 recently graded assignments or announcements.
+ * @property {DashboardItem[]} dashboardItems Array of items that can be shown on the dashboard
+ * @property {DashboardItem[]} leftDashboard Items on the left side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
+ * @property {DashboardItem[]} rightDashboard Items on the right side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
+ * @property {object} remoteConfig Configuration variables that can be remotely changed
+ * @property {boolean} searchScrollListener True if the search scroll listener has been added
+ */
+var dtps = {
+ ver: 310,
+ readableVer: "v3.1.0",
+ env: new URL(window.dtpsBaseURL || "https://powerplus.app").hostname == "localhost" ? "dev" : window.jottocraftSatEnv || "prod",
+ classes: [],
+ baseURL: window.dtpsBaseURL || "https://powerplus.app",
+ unstable: window.dtpsBaseURL !== "https://powerplus.app",
+ gradebookExpanded: false,
+ updates: [],
+ dashboardItems: [
+ {
+ name: "Calendar",
+ id: "dtps.calendar",
+ icon: "event",
+ size: 100,
+ defaultSide: "left"
+ }, {
+ name: "Updates",
+ id: "dtps.updates",
+ icon: "calendar_view_day",
+ size: 170,
+ defaultSide: "left"
+ }, {
+ name: "Due Today",
+ id: "dtps.dueToday",
+ icon: "check_circle_outline",
+ size: 20,
+ defaultSide: "right"
+ }, {
+ name: "Upcoming Assignments",
+ id: "dtps.upcoming",
+ icon: "view_stream",
+ size: 250,
+ defaultSide: "right"
+ }
+ ],
+ remoteConfig: {
+ showBugReportButton: false,
+ gradeCalculationEnabled: true,
+ allowWhatIfGrades: true,
+ showVideoMeetingButton: true,
+ dtechHomepageFluidUITabs: true,
+ dtechCurrentTerm: "20-21",
+ debugClassID: "1098",
+ topSneaky: false,
+ topSneakyUI: false,
+ remoteUpdate: {
+ title: null,
+ md: null,
+ active: false
+ }
+ }
+};
+
+//Load jQuery ASAP
+jQuery.getScript("https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js");
+
+/**
+ * Debugging shortcut for getting the selected class. This should only be used in the web inspector and not in actual code.
+ *
+ * @return {object|undefined} The selected class
+ */
+dtps.class = function () {
+ return dtps.classes[dtps.selectedClass];
+}
+
+/**
+ * Fetches and displays the DTPS changelog modal
+ *
+ * @param onlyIfNewVersion True if the changelog should only show if this is a new version
+ */
+dtps.changelog = function (onlyIfNewVersion) {
+ //Fetch latest changelog from GitHub releases
+ jQuery.getScript("https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js", function () {
+ markdown = new showdown.Converter();
+ jQuery.getJSON("https://api.github.com/repos/jottocraft/dtps/releases/latest", function (data) {
+ //Convert changelog to HTML and render in the changelog card
+ var changelogHTML = markdown.makeHtml(data.body);
+ jQuery(".card.changelog").html(`<i onclick="fluid.cards.close('.card.changelog')" class="fluid-icon close">close</i>` + changelogHTML);
+
+ if (!onlyIfNewVersion) {
+ //Show changelog
+ fluid.cards.close(".card.focus");
+ fluid.cards(".card.changelog");
+ } else if (Number(data.tag_name.replace(/[^0-9]/g, '')) > Number(window.localStorage.dtps)) {
+ //Show changelog if this is a new(er) version
+ localStorage.setItem('dtps', data.tag_name.replace(/[^0-9]/g, ''));
+
+ if (!data.tag_name.includes("s")) {
+ //s in tag_name means a silent release
+ fluid.cards.close(".card.focus");
+ fluid.cards(".card.changelog");
+ }
+ }
+ });
+ });
+};
+
+/**
+ * Logs debugging messages
+ *
+ * @param {string} msg The debugging message to log
+ */
+dtps.log = function (msg) {
+ if (dtps.env == "dev") console.log("[DTPS]", msg);
+}
+
+
+/**
+ * Shows an error message alert and logs to console
+ *
+ * @param {string} msg The error to display
+ * @param {string} [devNotes] Technical error details displayed in a smaller font
+ * @param {Error} [err] An error object to log to the console. If this is null, DTPS will assume the error has been handled elsewhere.
+ */
+dtps.error = function (msg, devNotes, err) {
+ if (err !== null) {
+ var formattedDevNotes = "";
+ if (devNotes) {
+ formattedDevNotes = '<div style="font-size: 12px; color: var(--secText, gray); margin-top: 10px;">' + devNotes + '</div>';
+ }
+ console.error("[DTPS !!ERROR!!]", devNotes + ": ", err);
+ fluid.alert("Error", msg + formattedDevNotes, "error");
+ }
+}
+
+/**
+ * Renders "Welcome to Project DTPS" screen on the first run
+ */
+dtps.firstrun = function () {
+ //Set latest changelog version to current version
+ window.localStorage.setItem('dtps', dtps.ver);
+
+ //Welcome to DTPS screen HTML
+ jQuery(".card.changelog").html(/*html*/`
+ <h3 style="margin-bottom: 0px;">Welcome to Power+</h3>
+ <h5 style="color: var(--secText); font-weight: bold; font-size: 22px;">${dtps.readableVer}</h5>
+
+ <div class="welcomeSection">
+ <i class="fluid-icon">dashboard</i>
+ <h5>${dtpsLMS.gradebook ? "Manage your coursework and grades" : "Manage your coursework"}</h5>
+ <p>Power+ organizes all of your coursework so you can easily see what you need to do next. The dashboard shows upcoming assignments, recent grades, and announcements.
+ ${dtpsLMS.gradebook ? `Power+ includes a gradebook designed for ${dtpsLMS.name} to help you understand your grades.` : ``}</p>
+ </div>
+
+ ${dtpsLMS.isDemoLMS ? /*html*/`
+ <div class="welcomeSection">
+ <i class="fluid-icon">priority_high</i>
+ <h5>This is a demo</h5>
+ <p>Assignment information, grades, and other content displayed is not real and is for demonstration purposes only. This demo does not retrieve or collect any data.</p>
+ </div>
+ ` : /*html*/`
+ <div class="welcomeSection">
+ <i class="fluid-icon">security</i>
+ <h5>Privacy</h5>
+ <p>Power+ does not collect any information. All of the data used in Power+ is fetched directly from ${dtpsLMS.shortName} and is never sent anywhere else.
+ User preferences, grade history, and other Power+ data is stored locally on your computer and is not associated with your ${dtpsLMS.shortName} account.</p>
+ </div>
+ <div class="welcomeSection">
+ <i class="fluid-icon">priority_high</i>
+ <h5>Power+ is not official</h5>
+ <p>Assignment information, grades, and other content displayed in Power+ are not official. Power+ is neither created nor endorsed by ${dtpsLMS.legalName}.
+ Power+ may have bugs that could cause it to display inaccurate information. Use Power+ at your own risk.</p>
+ </div>
+ `}
+
+ <br />
+ <button onclick="window.localStorage.setItem('dtpsInstalled', 'true'); fluid.cards.close('.card.changelog');" class="btn">
+ <i class="fluid-icon">arrow_forward</i> Continue
+ </button>
+ `);
+
+ //Show Welcome to DTPS card
+ fluid.cards.close(".card.focus");
+ fluid.cards(".card.changelog", "stayOpen");
+};
+
+/**
+ * Renders the DTPS loading screen
+ */
+dtps.renderLoadingScreen = function () {
+ if (!window.dtpsPreLoader || dtps.user) {
+ //Only show the loader if the extension hasn't already shown it
+ jQuery("body").append(/*html*/`
+ <div id="dtpsNativeOverlay" style="background-color: #151515; position: fixed; top: 0px; left: 0px; width: 100%; height: 100vh; z-index: 99;text-align: center;z-index: 999;transition: opacity 0.2s;">
+ <img style="height: 100px; margin-top: 132px;" src="https://i.imgur.com/7dDUVh2.png" />
+ <br />
+ <div class="progress"><div class="indeterminate"></div></div>
+ <style>body {background-color: #151515; overflow: hidden;}*,:after,:before{box-sizing:border-box}.progress{position:relative;width:600px;height:5px;overflow:hidden;border-radius:12px;background:#262626;backdrop-filter:opacity(.4);display:inline-block;margin-top:75px}.progress .indeterminate{position:absolute;background:#e3ba4b;height:5px;animation:indeterminate 1.4s infinite;animation-timing-function:linear}@keyframes indeterminate{0%{width:5%;left:-15%}to{width:100%;left:110%}}</style>
+ </div>
+ `);
+ }
+}
+
+/**
+ * Load all external JavaScript libraries
+ *
+ * @param {function} cb Callback function
+ */
+dtps.JS = function (cb) {
+ //Moment & Fullcalendar are used for the calendar on the dashboard
+ jQuery.getScript("https://cdn.jsdelivr.net/npm/[email protected]/main.min.js", function () {
+ jQuery.getScript("https://cdn.jsdelivr.net/npm/[email protected]/locales-all.min.js");
+ });
+
+ //Lunr is used for search
+ jQuery.getScript('https://unpkg.com/[email protected]/lunr.min.js');
+
+ //jQuery UI for dashboard settings page
+ jQuery.getScript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js');
+
+ //Tinycolor used for better dark mode support
+ jQuery.getScript("https://cdn.jottocraft.com/tinycolor.js");
+
+ //dtao/nearest-color is used for finding the nearest class color
+ jQuery.getScript("https://cdn.jottocraft.com/nearest-color.dtao.js", () => {
+ //Fluid UI for core UI elements
+ if (window.localStorage.getItem("pref-debuggingLocalFluidUI") == "true") {
+ jQuery.getScript('http://localhost:1222/dev/fluid.js', cb);
+ } else {
+ jQuery.getScript('https://cdn.jottocraft.com/fluid/build/v5/latest/fluid.js', cb);
+ }
+ });
+}
+
+/**
+ * Load all DTPS CSS files
+ */
+dtps.CSS = function () {
+ jQuery("<link/>", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: window.localStorage.getItem("pref-debuggingLocalFluidUI") == "true" ? "http://localhost:1222/dev/fluid.css" : "https://cdn.jottocraft.com/fluid/build/v5/latest/fluid.css",
+ class: "dtpsHeadItem"
+ }).appendTo("head");
+
+ jQuery("<link/>", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: dtps.baseURL + "/dtps.css",
+ class: "dtpsHeadItem"
+ }).appendTo("head");
+
+ jQuery("<link/>", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: "https://fonts.googleapis.com/css?family=Material+Icons+Round",
+ class: "dtpsHeadItem"
+ }).appendTo("head");
+
+ jQuery("<link/>", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: "https://cdn.jsdelivr.net/npm/[email protected]/main.min.css",
+ class: "dtpsHeadItem"
+ }).appendTo("head");
+
+ jQuery("<link/>", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css",
+ class: "dtpsHeadItem"
+ }).appendTo("head");
+}
+
+/**
+ * Starts DTPS (entrypoint function)
+ */
+dtps.init = function () {
+ //Initial log
+ dtps.log("Starting DTPS " + dtps.readableVer + "...");
+
+ //Check for LMS config
+ if (!window.dtpsLMS) {
+ throw "Error: No DTPS LMS configuration found";
+ }
+
+ //Determine if changelog should be shown
+ if (Number(window.localStorage.dtps) < dtps.ver) {
+ dtps.log("New release");
+ dtps.popup = "changelog";
+ }
+
+ //Determine if this is the first time loading DTPS
+ if (window.localStorage.dtpsInstalled !== "true") {
+ dtps.popup = "firstrun";
+ }
+
+ //Render loading screen
+ dtps.renderLoadingScreen();
+
+ //Get URL parameters
+ var urlParams = new URLSearchParams(window.location.search);
+ if (Array.from(urlParams).length) window.history.replaceState(null, null, window.location.pathname);
+
+ //Fluid UI settings
+ window.fluidConfig = {
+ config: {
+ autoLoad: false,
+ allowThemeMenu: false //This is false because Power+ uses its own theme settings UI
+ }
+ };
+
+ //Set env discovery
+ window.localStorage.setItem("jottocraftEnv", true);
+
+ //Default selected content
+ dtps.selectedContent = "stream";
+
+ //Begin loading CSS
+ dtps.CSS();
+
+ //Begin loading static DTPS HTML
+ dtps.render();
+
+ //Fetch remote config
+ new Promise((r) => {
+ jQuery.getJSON('https://project-dtps.firebaseio.com/config.json', (remoteConfig) => {
+ if (remoteConfig) {
+ Object.keys(remoteConfig).forEach(k => {
+ var val = remoteConfig[k];
+
+ dtps.remoteConfig[k] = val;
+ });
+ }
+ r();
+ }).fail(() => r());
+ }).then(() => {
+ //dev env remote config overrides
+ if (dtps.env == "dev") {
+ Object.keys(dtps.remoteConfig).forEach(k => {
+ if (window.localStorage.getItem("dtpsRemoteConfig-" + k)) {
+ val = window.localStorage.getItem("dtpsRemoteConfig-" + k);
+
+ if (val == "true") val = true;
+ if (val == "false") val = false;
+
+ dtps.remoteConfig[k] = val;
+ }
+ });
+ }
+
+ //Fetch user and class data
+ return dtpsLMS.fetchUser();
+ }).then(data => {
+ //Prevent resetting the user if the user is already set (for parent accounts)
+ dtps.user = data;
+
+ //If this is a parent account, show the parent UI
+ if (dtps.user.children && dtps.user.children.length) {
+ dtps.user.parent = true;
+
+ //Fetch classes for all students
+ return new Promise((resolve, reject) => {
+ var allClasses = [];
+ var promises = [];
+
+ dtps.user.children.forEach(child => {
+ promises.push(new Promise(function (resolve, reject) {
+ dtpsLMS.fetchClasses(child.id).then((data) => {
+ //Prepend child ID to class ID
+ data.forEach(course => {
+ course.id = child.id + "-" + course.id;
+ course.group = child.name;
+ });
+
+ allClasses = allClasses.concat(data);
+ resolve();
+ }).catch(reject);
+ }));
+ });
+
+ Promise.all(promises).then(() => {
+ resolve(allClasses);
+ });
+ });
+ } else {
+ return dtpsLMS.fetchClasses(dtps.user.id);
+ }
+ }).then((rawClasses) => {
+ return new Promise((resolve, reject) => {
+ if (dtpsLMS.institutionSpecific && dtpsLMS.updateClasses) {
+ //Using an institution-specific script, make any nessasary changes and return updated classes
+ dtpsLMS.updateClasses(rawClasses).then((updatedClasses) => {
+ resolve(updatedClasses);
+ }).catch((e) => {
+ reject(e);
+ });
+ } else {
+ //No institution-specific script, return classes as-is
+ resolve(rawClasses);
+ }
+ });
+ }).then(classData => {
+ //Store classData to dtps.classes
+ dtps.classes = classData;
+
+ //Add course num props
+ dtps.classes.forEach((course, index) => course.num = index);
+
+ //Fetch JavaScript modules
+ dtps.JS(() => {
+ //Define DTPS class color pallete
+ var nearestCourseColor = nearestColor.from({
+ //Primary color shades
+ red: "#cc4747",
+ brown: "#9a4429",
+ orange: "#ce734e",
+ pumpkin: "#c58535",
+ yellow: "#b58f38",
+ yellowGreen: "#7c9630",
+ green: "#439a47",
+ oceanGreen: "#339a70",
+ keppel: "#40b5c3",
+ skyBlue: "#40a4d6",
+ blue: "#2d72a0",
+ purple: "#985cab",
+ magenta: "#bd3e69",
+ pink: "#ec7ca5",
+ gray: "#888888",
+ //Dark color shades
+ gold: "#94652a",
+ darkRed: "#943f3f",
+ darkBlue: "#485182",
+ darkPurple: "#6f4882",
+ darkGreen: "#3d7358",
+ //Light color shades
+ lightOrange: "#ea7a44",
+ lightRed: "#e07f7f",
+ lightBlue: "#76c1e6",
+ lightPurple: "#978fd6",
+ lightGreen: "#7ebb95",
+ lightBrown: "#928871"
+ });
+
+ //Loop over each class to update the color and check for grade calculation
+ dtps.classes.forEach(course => {
+ course.color = course.color ? nearestCourseColor(course.color).value : "gray";
+
+ if (dtpsLMS.calculateGrade && dtps.remoteConfig.gradeCalculationEnabled) {
+ //This LMS/Institution supports grade calculation, show loading indicator for grade
+ //Grade will be calculated once assignments are fetched
+
+ course.letter = "..."; //Setting this to ... shows the loading indicator
+ course.grade = undefined;
+ }
+ });
+
+ //Fluid UI screens
+ fluid.defaultScreen = "dashboard";
+ fluid.screens.dashboard = dtps.baseURL + "/scripts/assignments.js";
+ fluid.screens.stream = dtps.baseURL + "/scripts/assignments.js";
+ fluid.screens.moduleStream = dtps.baseURL + "/scripts/assignments.js";
+ fluid.screens.people = dtps.baseURL + "/scripts/people.js";
+ fluid.screens.search = dtps.baseURL + "/scripts/search.js";
+ fluid.screens.pages = dtps.baseURL + "/scripts/pages-discussions.js";
+ fluid.screens.discussions = dtps.baseURL + "/scripts/pages-discussions.js";
+
+ if (dtpsLMS.gradebook && !((dtps.env == "dev") && (fluid.get("pref-debuggingGenericGradebook") == "true"))) {
+ //Handle LMS gradebook
+ fluid.screens.gradebook = dtps.showLMSGradebook;
+ } else if (dtpsLMS.genericGradebook || ((dtps.env == "dev") && (fluid.get("pref-debuggingGenericGradebook") == "true"))) {
+ //Generic gradebook script
+ fluid.screens.gradebook = dtps.baseURL + "/scripts/assignments.js";
+ }
+
+ //Begin fetching class assignments
+ var fetchedAnnouncements = [];
+ dtps.classes.forEach((course, courseIndex) => {
+ dtpsLMS.fetchAssignments(course.userID, course.lmsID).then((rawAssignments) => {
+ return new Promise((resolve, reject) => {
+ if (dtpsLMS.institutionSpecific && dtpsLMS.updateAssignments) {
+ //Using an institution-specific script, make any nessasary changes and return updated assignments
+ dtpsLMS.updateAssignments(rawAssignments).then(updatedAssignments => {
+ resolve(updatedAssignments);
+ }).catch(reject);
+ } else {
+ //No institution-specific script, return assignments as-is
+ resolve(rawAssignments);
+ }
+ });
+ }).then(assignments => {
+ //Store assignments in the class
+ course.assignments = assignments;
+
+ //Add class props to assignments and add recent assignments to updates array
+ course.assignments.forEach(assignment => {
+ assignment.class = courseIndex;
+
+ if (assignment.gradedAt && assignment.grade) {
+ //Add class number and type to object
+ dtps.updates.push({
+ class: course.num,
+ type: "assignment",
+ ...assignment
+ })
+ }
+ });
+
+ //Sort updates array from newest -> oldest
+ dtps.updates.sort(function (a, b) {
+ //Sort by postedAt (announcements) or gradedAt (assignments)
+ return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
+ });
+
+ //Keep only the 15 most recent updates
+ if (dtps.updates.length > 15) dtps.updates.length = 15;
+
+ //Calculate class grade if supported
+ if (dtpsLMS.calculateGrade && dtps.remoteConfig.gradeCalculationEnabled) {
+ let gradeCalcResults = dtpsLMS.calculateGrade(course, assignments);
+
+ if (gradeCalcResults) {
+ //This class has a grade
+
+ //Set course letter and grade to grade calc results
+ course.letter = gradeCalcResults.letter;
+ course.grade = gradeCalcResults.grade;
+
+ //Save raw results object to the course so it can be accessed by the gradebook
+ course.gradeCalculation = gradeCalcResults;
+ } else {
+ //No grade for this class
+ course.letter = null;
+ course.grade = null;
+ }
+
+ //Force re-render sidebar to show grades only if the user isn't on pages or discussions
+ if ((dtps.selectedContent !== "pages") && (dtps.selectedContent !== "discuss")) {
+ dtps.showClasses(true);
+ }
+ }
+
+ //Grade history and gradebook
+ if (course.letter && (course.letter !== "...")) {
+ //Enable gradebook for this class
+ course.hasGradebook = true;
+
+ //Save grade history
+ dtps.logGrades(courseIndex);
+
+ //If the class is selected, call dtps.presentClass again to show the grades tab
+ if (courseIndex == dtps.selectedClass) {
+ dtps.presentClass(courseIndex);
+
+ //If the gradebook is selected, reload the gradebook
+ if (dtps.selectedContent == "grades") {
+ fluid.screen('gradebook', dtps.classes[courseIndex].id);
+ }
+ }
+ } else {
+ //This class doesn't have a gradebook, exit gradebook if selected
+ if ((courseIndex == dtps.selectedClass) && (dtps.selectedContent == "grades")) {
+ fluid.screen('stream', dtps.classes[courseIndex].id);
+ }
+ }
+
+ //Render grades tab in settings
+ if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
+
+ //Re-render screen if the dashboard or stream is selected
+ if ((dtps.selectedClass == "dash") || ((dtps.selectedContent == "stream") && (dtps.selectedClass == course.num))) {
+ fluid.screen();
+ }
+ });
+
+ if (!fetchedAnnouncements.includes(course.lmsID)) {
+ //Add lmsID to list of fetched announcements to prevent duplicates
+ fetchedAnnouncements.push(course.lmsID);
+
+ dtpsLMS.fetchAnnouncements(course.lmsID).then(announcements => {
+ //Add announcements to updates array
+ announcements.forEach(announcement => {
+ //Add class number and type to object
+ dtps.updates.push({
+ class: course.num,
+ type: "announcement",
+ ...announcement
+ });
+ });
+
+ //Sort updates array from newest -> oldest
+ dtps.updates.sort(function (a, b) {
+ //Sort by postedAt (announcements) or gradedAt (assignments)
+ return new Date(b.gradedAt || b.postedAt).getTime() - new Date(a.gradedAt || a.postedAt).getTime()
+ });
+
+ //Keep only the 15 most recent updates
+ if (dtps.updates.length > 15) dtps.updates.length = 15;
+
+ if (dtps.selectedClass == "dash") {
+ fluid.screen();
+ }
+ });
+ }
+ });
+
+ //Render remaining HTML
+ dtps.renderLite();
+
+ //Render initial screen
+ fluid.screen();
+
+ //Load popup if needed
+ if (dtps.popup == "firstrun") {
+ dtps.firstrun();
+ } else if (dtps.popup == "changelog") {
+ //Changelog will only show if the release notes are on GitHub
+ dtps.changelog(true);
+ }
+
+ //Check URL parameter
+ if ((urlParams.get("prerelease") == "canary") && urlParams.get("repo")) {
+ fluid.alert("Power+ Canary", "<p>Do you want to add this release configuration to Power+?</p>", "build_circle", [
+ {
+ name: "Add",
+ icon: "add",
+ action: "window.localStorage.githubCanary = '" + urlParams.get("repo") + "'; alert('Please reload the page for changes to take effect');"
+ },
+ {
+ name: "Cancel",
+ icon: "cancel"
+ }
+ ]);
+ }
+ });
+ }).catch(function (err) {
+ //Web request error
+ console.error("[DTPS] Error fetching user and classes at dtps.init", err);
+
+ //Check for login redirect
+ if ((err.action == "login") && err.redirectURL) {
+ //Redirect to login page
+ window.location.href = err.redirectURL;
+ } else {
+ dtps.error("Failed to get user and/or course data", "Exception in promise @ dtps.init");
+ }
+ });
+
+ //Load dashboard prefrences
+ dtps.loadDashboardPrefs();
+}
+
+/**
+ * Formats a date to a readable date string
+ *
+ * @param {Date} date The date to format
+ * @return {string} Formatted date and time string
+ */
+dtps.formatDate = function (date) {
+ if (date) {
+ return new Date(date).toLocaleString("en", { weekday: 'short', month: 'short', day: 'numeric', hour: "numeric", minute: "numeric" });
+ } else {
+ return "";
+ }
+}
+
+/**
+ * Adjusts the height of an iFrame to match its content
+ *
+ * @param {string} iframeID The ID of the iFrame element to adjust
+ */
+dtps.iframeLoad = function (iframeID) {
+ var iFrame = document.getElementById(iframeID);
+ if (iFrame) {
+ iFrame.height = "";
+ iFrame.height = iFrame.contentWindow.document.body.scrollHeight + "px";
+ }
+}
+
+/**
+ * Clears all DTPS data
+ */
+dtps.clearData = function () {
+ if (window.confirm("Clearing Power+ data will clear all local user data stored by Power+. This should be done if it is a new semester / school year or if you are having issues with Power+. Are you sure you want to clear all your Power+ data?")) {
+ window.localStorage.clear()
+ window.alert("Power+ data cleared")
+ }
+}
+
+/**
+ * Renders the class list in the sidebar
+ *
+ * @param {boolean} [override] True if the sidebar should be forcefully re-rendered
+ */
+dtps.showClasses = function (override) {
+ //Array of class HTML for the sidebar
+ dtps.classlist = [];
+
+ var previousClassGroup = null;
+ for (var i = 0; i < dtps.classes.length; i++) {
+ //Determine letter grade HTML
+ var letterGradeHTML = "";
+ if (dtps.classes[i].letter) letterGradeHTML = dtps.classes[i].letter;
+ if (dtps.classes[i].letter == null) letterGradeHTML = "--";
+ if (dtps.classes[i].letter == "...") letterGradeHTML = `<div class="shimmer" style="width: 100%;height: 22px;border-radius: 8px;"></div>`; //Show loading indicator for ...
+
+ if (dtps.classes[i].group && (dtps.classes[i].group !== previousClassGroup)) {
+ if (previousClassGroup) dtps.classlist.push(`</div></div>`);
+ dtps.classlist.push(/*html*/`
+ <div id="dtpsClassListGroup-${dtps.classes[i].group}" class="group open">
+ <div class="name item">
+ <i class="fluid-icon"></i> <span class="label">${dtps.classes[i].group}</span>
+ </div>
+
+ <div class="items">
+ `);
+ } else if (!dtps.classes[i].group && previousClassGroup) {
+ dtps.classlist.push(`</div></div>`);
+ }
+
+ //Add class HTML to array
+ dtps.classlist.push(/*html*/`
+ <div
+ onclick="${'dtps.selectedClass = ' + i}"
+ class="${'class item ' + i + ' ' + (dtps.selectedClass == i ? " active" : "")}"
+ style="${'--classColor: ' + dtps.classes[i].color}"
+ >
+ <i class="fluid-icon grade">${letterGradeHTML}</i>
+ <span class="label">${dtps.classes[i].subject}</span>
+ </div>
+ `);
+
+ previousClassGroup = dtps.classes[i].group;
+ }
+
+ if (previousClassGroup) dtps.classlist.push(`</div></div>`);
+
+ //Only render HTML if the sidebar doesn't already have the classes rendered, or if override is true
+ if (!jQuery(".sidebar .class.dash")[0] || override) {
+ jQuery(".sidebar").html(/*html*/`
+ <div class="title">
+ <img src="${dtps.baseURL + "/icon.svg"}" />
+ <h4>Power+</h4>
+ </div>
+
+ <div class="items">
+ <div onclick="dtps.selectedClass = 'dash';" class="class item main dash ${dtps.selectedClass == "dash" ? "active" : ""}">
+ <i class="fluid-icon">dashboard</i>
+ <span class="label">Dashboard</span>
+ </div>
+
+ <div class="divider"></div>
+
+ ${dtps.classlist.join("")}
+ </div>
+
+ <div class="collapse">
+ <i class="fluid-icon"></i>
+ </div>
+ `);
+ fluid.init();
+
+ //Change view to stream if coming from pages or discussions, since those tabs change the sidebar
+ if ((dtps.selectedContent == "pages") || (dtps.selectedContent == "discuss")) {
+ //Show stream
+ if (dtps.classes[dtps.selectedClass]) fluid.screen('stream', dtps.classes[dtps.selectedClass].id);
+ }
+
+ //Class onclick listener
+ $(".class:not(.overrideClass)").click(function (event) {
+ //Load class content based on what's selected
+ if (((dtps.selectedContent == "stream") || (dtps.selectedContent == "moduleStream")) && dtps.classes[dtps.selectedClass]) {
+ if (dtps.classes[dtps.selectedClass].modules && (window.localStorage.getItem("courseworkPref-" + dtps.classes[dtps.selectedClass].id) == "moduleStream")) {
+ fluid.screen("moduleStream", dtps.classes[dtps.selectedClass].id);
+ } else {
+ fluid.screen("stream", dtps.classes[dtps.selectedClass].id);
+ }
+ }
+
+ if ((dtps.selectedContent == "people") && dtps.classes[dtps.selectedClass]) {
+ fluid.screen("people", dtps.classes[dtps.selectedClass].id);
+ }
+
+ if ((dtps.selectedContent == "grades") && dtps.classes[dtps.selectedClass]) {
+ if (dtps.classes[dtps.selectedClass].hasGradebook) {
+ fluid.screen("gradebook", dtps.classes[dtps.selectedClass].id);
+ } else {
+ fluid.screen("stream", dtps.classes[dtps.selectedClass].id);
+ }
+ }
+
+ if (dtps.selectedClass == "dash") {
+ fluid.screen("dashboard");
+ }
+ });
+ }
+}
+
+/**
+ * Renders the class header (color, name, tabs, etc.) and sets the class as the selected class
+ *
+ * @param {number|string} classNum The class number to load or "dash" if loading the dashboard
+ */
+dtps.presentClass = function (classNum) {
+ //Set classNum as selected class
+ dtps.selectedClass = classNum;
+
+ //Update document title with class name
+ if (dtps.classes[classNum]) {
+ document.title = dtps.classes[classNum].subject + " | Power+";
+ } else {
+ document.title = "Power+";
+ }
+
+ //Set the class image
+ if ((fluid.get("pref-showClassImages") !== "false") && dtps.classes[classNum] && dtps.classes[classNum].image) {
+ $(".headerArea").addClass("classImage");
+ $(".headerArea img").attr("src", dtps.classes[classNum].image);
+ $(".headerArea img").show();
+ } else {
+ $(".headerArea").removeClass("classImage");
+ $(".headerArea img").hide();
+ }
+
+ //Remove active class from other classes in the sidebar, add the active class to the selected class
+ $(".sidebar .class").removeClass("active");
+ $(".class." + classNum).addClass("active");
+
+ //Update title to show class name
+ //If the dashboard is selected, this is just "Dashboard". Otherwise, this is Class.subject
+ $("#headText span").text(classNum == "dash" ? "Dashboard" : classNum == "search" ? "Search Results" : dtps.classes[classNum] && dtps.classes[classNum].subject);
+ var icon = classNum == "dash" ? "dashboard" : classNum == "search" ? "search" : dtps.classes[classNum] && dtps.classes[classNum].icon
+ if (icon) {
+ $("#headText i").text(icon);
+ $("#headText i").show();
+ } else {
+ $("#headText i").hide();
+ }
+ $("#headText").css("color", (classNum == "dash") || (classNum == "search") ? "var(--text)" : dtps.classes[classNum] && dtps.classes[classNum].color);
+
+ //If the class doesn't exist, hide the tabs
+ //Otherwise, show the tabs
+ if (!dtps.classes[classNum]) {
+ $("#dtpsTabBar").hide();
+ $("#classInfo p").hide();
+ } else {
+ $("#dtpsTabBar").show();
+ }
+
+ //Hide dashboard start date
+ if (classNum !== "search") $(".headerArea .contentLabel").hide();
+
+ //Clear search box if not on the search tab
+ if ((classNum !== "search") && !$("#dtpsMainSearchBox").is(":focus")) {
+ $("#dtpsMainSearchBox").val("");
+ }
+
+ //Set search box content
+ if (classNum !== "search") dtps.setSearchBox();
+
+ if (dtps.classes[classNum]) {
+ //Show pages tab if the class supports it, otherwise, hide it
+ if (dtps.classes[classNum].pages) {
+ $(".btns .btn.pages").show();
+ } else {
+ $(".btns .btn.pages").hide();
+ }
+
+ //Show people tab if the LMS supports it, otherwise, hide it
+ if (dtps.classes[classNum].people) {
+ $(".btns .btn.people").show();
+ } else {
+ $(".btns .btn.people").hide();
+ }
+
+ //Show pages tab if the class supports it, otherwise, hide it
+ if (dtps.classes[classNum].discussions) {
+ $(".btns .btn.discuss").show();
+ } else {
+ $(".btns .btn.discuss").hide();
+ }
+
+ //Show gradebook if the LMS and the class supports it, otherwise, hide it
+ if ((dtpsLMS.genericGradebook || dtpsLMS.gradebook) && dtps.classes[classNum].hasGradebook) {
+ $(".btns .btn.grades").show();
+ } else {
+ $(".btns .btn.grades").hide();
+ }
+
+ //Hide tabs if only one tab is visible
+ if ($("#dtpsTabBar .btn:visible").length < 2) {
+ $("#dtpsTabBar").hide();
+ }
+
+ //Show teacher
+ if (dtps.classes[classNum].teacher) {
+ $("#classInfo .teacher .teacherName").text(dtps.classes[classNum].teacher.name);
+ $("#classInfo .teacher .teacherImage").css("background-image", "url('" + dtps.classes[classNum].teacher.photoURL + "')");
+ $("#classInfo .teacher").show();
+ } else {
+ $("#classInfo .teacher").hide();
+ }
+
+ if (dtps.classes[classNum].homepage) {
+ $("#classInfo .homepage").show();
+ } else {
+ $("#classInfo .homepage").hide();
+ }
+
+ if (dtps.classes[classNum].videoMeetingURL) {
+ $("#classInfo .videoMeeting").attr("onclick", "window.open('" + dtps.classes[classNum].videoMeetingURL + "')");
+ $("#classInfo .videoMeeting").removeClass("shimmerParent");
+ $("#classInfo .videoMeeting").show();
+ } else if ((dtps.classes[classNum].videoMeetingURL !== null) && dtpsLMS.fetchMeetingURL) {
+ $("#classInfo .videoMeeting").attr("onclick", "");
+ $("#classInfo .videoMeeting").addClass("shimmerParent");
+ $("#classInfo .videoMeeting").show();
+
+ dtpsLMS.fetchMeetingURL(dtps.classes[classNum].lmsID).then(url => {
+ dtps.classes[classNum].videoMeetingURL = url;
+
+ if (dtps.selectedClass == classNum) {
+ if (url) {
+ $("#classInfo .videoMeeting").attr("onclick", "window.open('" + dtps.classes[classNum].videoMeetingURL + "')");
+ $("#classInfo .videoMeeting").removeClass("shimmerParent");
+ $("#classInfo .videoMeeting").show();
+ } else {
+ $("#classInfo .videoMeeting").hide();
+ }
+ }
+ });
+ } else {
+ $("#classInfo .videoMeeting").hide();
+ }
+ }
+
+ console.log(dtps.selectedContent);
+ if (dtps.selectedContent !== "grades") $(".classContent").removeClass("fixedGradeSummary");
+}
+
+/**
+ * Displays the class homepage
+ *
+ * @param {number} num Class number to show the homepage for
+ */
+dtps.classHome = function (num) {
+ //Render loading screen
+ $(".card.details").html(/*html*/`
+ <i onclick="fluid.cards.close('.card.details')" class="fluid-icon close">close</i>
+ <h3 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h3>
+
+ <br />
+ <p>Loading...</p>
+ `);
+
+ //Fetch homepage from the LMS
+ dtpsLMS.fetchHomepage(dtps.classes[num].lmsID).then(homepage => {
+ if (homepage) {
+ //Get computed background and text color to style the iFrame with
+ var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+ var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
+
+ if ($("body").hasClass("dark")) {
+ homepage = dtps.brightenTextForDarkMode(homepage, computedBackgroundColor);
+ }
+
+ if (dtpsLMS.dtech && dtps.remoteConfig.dtechHomepageFluidUITabs && ($('<div></div>').append(homepage).find(".enhanceable_content.tabs>ul>li").toArray().length > 1)) {
+ //Use special tab optimized homepage
+ var fragments = [];
+ $('<div></div>').append(homepage).find(".enhanceable_content.tabs>ul>li").toArray().forEach((fragment) => {
+ var text = $(fragment).text().toLowerCase();
+ if (!text) return;
+
+ var id = $(fragment).find("a").attr("href").replace("#", "");
+ if (!id) return;
+
+ var html = $(homepage).find("#" + id).html();
+ if (!html) return;
+
+ var icon = null;
+ if (text.includes("agenda")) { icon = "format_list_numbered"; text = "Agenda"; }
+ if (text.includes("instructor")) { icon = "person"; text = "Instructor"; }
+ if (text.includes("course info")) { icon = "info"; text = "Course Info"; }
+ if (text.includes("resources")) { icon = "article"; text = "Course Resources"; }
+
+ //Generate a blob with the assignment body and get its data URL
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
+ ${html}
+ `], { type: 'text/html' });
+ var frameURL = window.URL.createObjectURL(blob);
+
+ fragments.push({ text, id, icon, frameURL });
+ });
+
+ $(".card.details").html(/*html*/`
+ <i onclick="fluid.cards.close('.card.details')" class="fluid-icon close">close</i>
+
+ <h4 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h4>
+
+ <br />
+ ${dtps.classes[num].videoMeetingURL ? `<button onclick="window.open('${dtps.classes[num].videoMeetingURL}')" class="btn small"><i class="fluid-icon">videocam</i> Zoom</button>` : ``}
+ <div class="btns row small">
+ ${fragments.map((fragment, i) => {
+ return `<button onclick="$(this).addClass('active');$(this).siblings().removeClass('active');$('#homepageFragment').attr('src', '${fragment.frameURL}'); dtps.iframeLoad('homepageFragment');"
+ style="text-transform: capitalize;" class="btn ${i == 0 ? "active" : ""}">${fragment.icon ? `<i class="fluid-icon">${fragment.icon}</i> ` : ""}${fragment.text}</button>`;
+ }).join("")}
+ </div>
+
+ <br />
+ <div style="margin-top: 20px;" class="homepageBody">
+ <iframe id="homepageFragment" onload="dtps.iframeLoad('homepageFragment')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${fragments[0].frameURL}" />
+ </div>
+ `);
+ } else {
+ //Generate a blob with the assignment body and get its data URL
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
+ ${homepage}
+ `], { type: 'text/html' });
+ var homepageURL = window.URL.createObjectURL(blob);
+
+ $(".card.details").html(/*html*/`
+ <i onclick="fluid.cards.close('.card.details')" class="fluid-icon close">close</i>
+
+ <h4 style="font-weight: bold;">${dtps.classes[num].subject} Homepage</h4>
+
+ <br />
+ <div style="margin-top: 20px;" class="homepageBody">
+ <iframe id="homepageIframe" onload="dtps.iframeLoad('homepageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${homepageURL}" />
+ </div>
+ `);
+ }
+
+ fluid.cards(".card.details");
+ } else {
+ fluid.cards.close('.card.details');
+ dtps.error("Homepage unavailable", "homepage is either empty or undefined @ dtps.classHome");
+ }
+ }).catch(e => {
+ dtps.error("Couldn't load homepage", "Caught a promise rejection @ dtps.classHome", e);
+ })
+}
+
+/**
+ * Shows the gradebook using HTML from dtpsLMS.gradebook
+ *
+ * @param {string} classID Class ID
+ */
+dtps.showLMSGradebook = function (classID) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(classID);
+ dtps.selectedClass = classNum;
+
+ //Set stream as the selected content
+ dtps.selectedContent = "grades";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.grades").addClass("active");
+
+ //Load class color, name, etc.
+ dtps.presentClass(classNum);
+
+ //Ensure classes are shown in the sidebar
+ dtps.showClasses();
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.showLMSGradebook");
+ }
+
+ //Show loading indicator
+ if ((dtps.selectedContent == "grades") && (dtps.selectedClass == classNum)) {
+ jQuery(".classContent").html(`<div class="spinner"></div>`);
+ }
+
+ //Function to load gradebook HTML
+ function renderGradebook() {
+ dtpsLMS.gradebook(dtps.classes[classNum]).then(html => {
+ if (html && (dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
+ $(".classContent").html(html);
+ if (dtpsLMS.gradebookDidRender) dtpsLMS.gradebookDidRender(dtps.classes[classNum]);
+ }
+ }).catch(function (err) {
+ dtps.error("Could not load the gradebook", "Caught promise rejection @ dtps.showLMSGradebook", err);
+ });
+ }
+
+ if (!fluid.externalScreens.stream) {
+ //Load assignment functions first
+ jQuery.getScript(dtps.baseURL + "/scripts/assignments.js", () => {
+ renderGradebook();
+ })
+ } else {
+ renderGradebook();
+ }
+}
+
+/**
+ * Shows a URL in the iFrame card
+ *
+ * @param {string} url The URL to load
+ */
+dtps.showIFrameCard = function (url) {
+ //Remove any previous URLs
+ $('#CardIFrame').attr('src', '');
+
+ //Show iFrame card
+ fluid.cards('.card.iFrameCard');
+
+ //Load new URL
+ $('#CardIFrame').attr('src', url);
+}
+
+/**
+ * Brightens text in an HTML string for dark mode
+ *
+ * @param {string} html The HTML to brighten text for
+ * @param {string} [bg] The background color that the HTML will be displayed on
+ * @returns {string} HTML string with brightened colors
+ */
+dtps.brightenTextForDarkMode = function (html, bg) {
+ //Use dark mode algorithm
+ if (!bg) bg = "black";
+ var fakeRoot = $('<div></div>').append(html);
+ fakeRoot.find("span").filter(function () {
+ return $(this).css("color") && !($(this).css("background-color") || $(this).css("background")) && !$(this).parents().filter(function () {
+ return $(this).css("background-color") || $(this).css("background");
+ }).length;
+ }).toArray().forEach(element => {
+ //Brighten color
+ var brightness = tinycolor($(element).css("color")).getBrightness() / 255 * 100;
+ var targetBrightness = (100 - (tinycolor(bg).getBrightness() / 255 * 100)) - brightness;
+ var brightnessDiff = targetBrightness - brightness;
+
+ if (brightnessDiff > 0) {
+ $(element).css("color", "#" + tinycolor($(element).css("color")).brighten(Math.abs(brightnessDiff)).toHex());
+ } else {
+ $(element).css("color", "#" + tinycolor($(element).css("color")).darken(Math.abs(brightnessDiff)).toHex());
+ }
+ });
+ return fakeRoot.html();
+}
+
+/**
+ * Stores grade data locally for the previous grade feature
+ *
+ * @param classNum Class number to log grade
+ */
+dtps.logGrades = function (classNum) {
+ /*
+ Grade change vars:
+ gradeHistory-ID: current|previous (e.g. "A|B+" represents a change of B+ -> A)
+ if there is only one grade, it is the current one
+ */
+ if (window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id)) {
+ var savedCurrent = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[0];
+ var savedPrevious = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[1];
+
+ if (savedCurrent !== dtps.classes[classNum].letter) {
+ //Grade change
+ window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter + "|" + savedCurrent);
+ dtps.classes[classNum].previousLetter = savedCurrent;
+ }
+
+ if ((savedCurrent == dtps.classes[classNum].letter) && savedPrevious) {
+ //Previous grade is already saved
+ dtps.classes[classNum].previousLetter = savedPrevious;
+ }
+ } else {
+ //No history yet, store current grade
+ window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter);
+ }
+}
+
+/**
+ * Opens the settings page
+ *
+ * @param {boolean} [forceRerenderDashboard] If this is true, the dashboard settings will be re-rendered
+ */
+dtps.settings = function (forceRerenderDashboard) {
+ //Render dashboard HTML if not already loaded
+ if (forceRerenderDashboard || ($("#leftDashboardColumn").attr("loaded") !== "true")) {
+ //Returns dashboard item HTML from a dashboard item array
+ function dashboardHTML(dashboardArray) {
+ return dashboardArray.map(dashboardItem => {
+ return /*html*/`
+ <div dashboardItem-id="${dashboardItem.id}" style="height: ${dashboardItem.size * 1.7 + 50}px" class="dashboardItem">
+ <h5>
+ <i class="fluid-icon">${dashboardItem.icon}</i>
+ <span>${dashboardItem.name}</span>
+ </h5>
+ </div>
+ `;
+ }).join("");
+ }
+
+ //Render dashboard items
+ $("#leftDashboardColumn").html(dashboardHTML(dtps.leftDashboard));
+ $("#rightDashboardColumn").html(dashboardHTML(dtps.rightDashboard));
+
+ //Make dashboard items sortable
+ $(".dashboardColumn").sortable({
+ connectWith: ".dashboardColumn",
+ update: function (e, ui) {
+ dtps.saveDashboardPrefs();
+ }
+ });
+
+ //Store loaded state to prevent reloading dashboard items
+ $("#leftDashboardColumn").attr("loaded", "true");
+ }
+
+ //Render grades tab in settings
+ if (dtps.remoteConfig.showGradesInSettings) dtps.renderGradesInSettings();
+
+ fluid.cards('.settingsCard');
+}
+
+/**
+ * Shows a warning telling the user that they must reload for setting changes to take effect
+ */
+dtps.settingsReloadWarning = function () {
+ $("#settingsReloadWarning").show();
+}
+
+/**
+ * Renders the grades tab in settings
+ */
+dtps.renderGradesInSettings = function () {
+ //Render class grade bars
+ $("#classGradeBars").html(dtps.classes.map(course => {
+ //Percentages below are for visualization purposes only
+ var percentage = 0;
+ if (course.letter == "A") percentage = 100;
+ if (course.letter == "A-") percentage = 91;
+ if (course.letter == "B+") percentage = 88;
+ if (course.letter == "B") percentage = 85;
+ if (course.letter == "B-") percentage = 81;
+ if (course.letter == "C+") percentage = 78;
+ if (course.letter == "C") percentage = 75;
+
+ return (
+ course.letter ? `<div style="cursor: auto; background-color: var(--elements);" class="progressBar big">
+ <div style="color: white;" class="progressLabel">${course.subject} (${course.letter})</div>
+ <div class="progress" style="background-color: ${course.color}; width: calc(${percentage}% - 300px);"></div></div>` : ""
+ )
+ }));
+
+ //Calculate GPA
+ var sum = 0;
+ var values = 0;
+
+ dtps.classes.forEach(course => {
+ if (course.letter == "...") {
+ sum = null;
+ } else if (course.letter && (sum !== null)) {
+ var points = 0;
+ if (course.letter == "A") points = 4;
+ if (course.letter == "A-") points = 3.7;
+ if (course.letter == "B+") points = 3.3;
+ if (course.letter == "B") points = 3;
+ if (course.letter == "B-") points = 2.7;
+ if (course.letter == "C+") points = 2.3;
+ if (course.letter == "C") points = 2.0;
+ if (course.letter == "I") points = 0;
+
+ sum += points;
+ values++;
+ }
+ })
+
+ if (sum == null) {
+ $("#dtpsGpaText").text("...");
+ } else {
+ $("#dtpsGpaText").text((sum / values).toFixed(1));
+ }
+}
+
+/**
+ * Saves dashboard prefrences
+ */
+dtps.saveDashboardPrefs = function () {
+ var dashboardPrefs = [];
+
+ //Add dashboard items
+ for (var i = 0; i < $(".dashboardColumn").children().length; i++) {
+ //Get HTML item
+ var child = $($(".dashboardColumn").children()[i]);
+
+ //Add item to dashboardPrefs array
+ dashboardPrefs.push({
+ id: child.attr("dashboardItem-id"),
+ side: child.parent().attr("id").includes("left") ? "left" : "right"
+ });
+ }
+
+ //Save to local storage
+ window.localStorage.setItem("dtpsDashboardItems", JSON.stringify(dashboardPrefs));
+
+ //Reload dashboard items
+ dtps.loadDashboardPrefs();
+}
+
+/**
+ * Resets dashboard prefrences
+ */
+dtps.resetDashboardPrefs = function () {
+ //Remove dashboard pref from localStorage
+ window.localStorage.removeItem("dtpsDashboardItems");
+
+ //Reload dashboard items
+ dtps.loadDashboardPrefs();
+
+ //Re-render dashboard
+ dtps.settings(true);
+}
+
+/**
+ * Redirects to DTPS classic edition
+ */
+dtps.classicEntry = function () {
+ var classicName = ["P", "r", "o", "j", "e", "c", "t", " ", "D", "T", "P", "S"];
+ var overwrittenHTML = ["P", "o", "w", "e", "r", "+"];
+ if (dtps.classicStep == undefined) dtps.classicStep = -10;
+ dtps.classicStep++;
+
+ if (dtps.classicStep == 12) window.location.href = "/power+?classicEdition=true";
+
+ for (var i = 0; i < dtps.classicStep; i++) {
+ overwrittenHTML[i] = classicName[i];
+ }
+
+ $("#dtpsAboutName").html(overwrittenHTML.join(""));
+}
+
+/**
+ * Loads dashboard prefrences
+ */
+dtps.loadDashboardPrefs = function () {
+ //Define left and right dashboard columns
+ dtps.leftDashboard = [];
+ dtps.rightDashboard = [];
+
+ //Add items to dashboard columns
+ if (window.localStorage.dtpsDashboardItems) {
+ //Add from user prefs
+
+ //Parse JSON
+ var dashboardPref = JSON.parse(window.localStorage.dtpsDashboardItems);
+
+ //Generate arrays of dashboard item IDs
+ var dashboardIDs = dtps.dashboardItems.map(item => item.id);
+
+ //Add items to dashboard according to prefs
+ dashboardPref.forEach(dashboardItemPref => {
+ if (dashboardIDs.includes(dashboardItemPref.id)) {
+ //Get item index based on dashboardIDs array
+ var itemIndex = dashboardIDs.indexOf(dashboardItemPref.id);
+
+ //Get item from dtps.dashboardItems array
+ var dashboardItem = dtps.dashboardItems[itemIndex];
+
+ //Add item to dashboard
+ if (dashboardItemPref.side == "left") {
+ dtps.leftDashboard.push(dashboardItem);
+ } else if (dashboardItemPref.side == "right") {
+ dtps.rightDashboard.push(dashboardItem);
+ }
+ }
+ });
+ } else {
+ //Add from defaults
+ dtps.dashboardItems.forEach(dashboardItem => {
+ if (dashboardItem.defaultSide == "left") {
+ dtps.leftDashboard.push(dashboardItem);
+ } else if (dashboardItem.defaultSide == "right") {
+ dtps.rightDashboard.push(dashboardItem);
+ }
+ })
+ }
+}
+
+/**
+ * Renders initial static DTPS HTML
+ */
+dtps.render = function () {
+ //Remove all existing link tags and LMS head content
+ $("link:not(.dtpsHeadItem)").remove();
+ $("head *:not(.dtpsHeadItem)").remove();
+
+ //Set default body classes
+ $("body").attr("class", "dark showThemeWindows hasSidebar hasNavbar dashboard");
+
+ //Set document title and favicon
+ document.title = "Power+";
+ jQuery("<link/>", {
+ rel: "shortcut icon",
+ type: "image/png",
+ href: dtps.baseURL + "/favicon.png"
+ }).appendTo("head");
+
+ //Remove existing LMS HTML (excluding DTPS loading screen HTML)
+ jQuery("body *:not(#dtpsNativeOverlay):not(#dtpsNativeOverlay *)").remove();
+
+ //Render HTML
+ jQuery("body").append(/*html*/`
+ <div class="sidebar"></div>
+
+ <div class="navbar">
+ <div class="logo">
+ <img src="${dtps.baseURL + "/icon.svg"}" />
+ <h4>${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
+ </div>
+
+ ${dtps.unstable ? `
+ <div id="dtpsUnstable" class="navitem">
+ <i style="font-size: 16px;" class="fluid-icon">warning</i>
+ <span style="font-weight: bold; font-size: 10px;">THIS IS AN UNSTABLE VERSION OF POWER+. USE AT YOUR OWN RISK.</span>
+ </div>
+ ` : ""}
+
+ <div class="items" id="dtpsFixedSearch">
+ <i class="inputIcon fluid-icon">search</i>
+ <input id="dtpsMainSearchBox" style="margin: 0px; width: 500px;" type="search" class="inputIcon filled" placeholder="Search" />
+ </div>
+
+ <div class="profile">
+ <div class="profileImage"></div>
+ </div>
+ </div>
+
+ <div class="card profileMenu">
+ <div class="person">
+ <div class="profileImage"></div>
+ <div class="info">
+ <h5 class="name">Logged out</h5>
+ </div>
+ </div>
+
+ <div class="actions">
+ <div class="item">
+ <i class="fluid-icon">feedback</i>
+ <span class="label">Feedback</span>
+ </div>
+ ${dtps.remoteConfig.showBugReportButton || dtps.unstable || (dtps.env == "dev") ? /*html*/`
+ <div class="item">
+ <i class="fluid-icon">bug_report</i>
+ <span class="label">Bug Report</span>
+ </div>
+ ` : ""}
+ <div onclick="dtps.settings();" class="item">
+ <i class="fluid-icon">settings</i>
+ <span class="label">Settings</span>
+ </div>
+ <div class="divider"></div>
+ <a style="color: var(--text);" href="/">
+ <div class="item">
+ <i class="fluid-icon">exit_to_app</i>
+ <span class="label">Go to Canvas</span>
+ </div>
+ </a>
+ </div>
+ </div>
+
+ <div id="dtpsSearchResults" class="card acrylicMaterial" style="display: none;">
+ <h5 id="dtpsSearchStatus"><i class="fluid-icon">search</i> <span>Search</span></h5>
+ <div id="dtpsSearchData" style="display: none;"></div>
+ <div id="dtpsSearchInfo">
+ <p>By defualt, Power+ will search based on the page you're on. You can use the keywords below for more advanced searches:</p>
+ <div class="grid samesize">
+ <div class="item">
+ <p><i class="fluid-icon">library_books</i> type:coursework</p>
+ <p><i class="fluid-icon">view_module</i> type:module</p>
+ <p><i class="fluid-icon">assignment</i> type:assignment</p>
+ <p><i class="fluid-icon">assessment</i> type:grade</p>
+ <p><i class="fluid-icon">announcement</i> type:announcement</p>
+ </div>
+ <div class="item">
+ <p><i class="fluid-icon">home</i> type:homepage</p>
+ <p><i class="fluid-icon">insert_drive_file</i> type:page</p>
+ <p><i class="fluid-icon">forum</i> type:discussion</p>
+ <p><i class="fluid-icon">people</i> type:person</p>
+ <div class="divider"></div>
+ <p><i class="fluid-icon">class</i> class:English</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="headerArea classImage">
+ <img style="display: none;" />
+ <div class="content">
+ <h1 id="headText"><i class="fluid-icon">dashboard</i> <span>Dashboard</span></h1>
+ <div id="classInfo" style="min-height: 18px;">
+ <p class="teacher" style="display: none;">
+ <span class="teacherImage"></span> <span class="teacherName"></span>
+ </p>
+ <p onclick="dtps.classHome(dtps.selectedClass);" class="homepage" style="cursor: pointer; display: none;">
+ <i class="fluid-icon">home</i> <span>Homepage</span>
+ </p>
+ <p class="videoMeeting" style="cursor: pointer; display: none;">
+ <i class="fluid-icon">videocam</i> <span>Meeting</span>
+ </p>
+ <p class="contentLabel" style="display: none;">
+ <i class="fluid-icon"></i> <span></span>
+ </p>
+ </div>
+ <div style="display: none;" id="dtpsTabBar" class="btns">
+ <button init="true" onclick="if (dtps.classes[dtps.selectedClass].modules && (window.localStorage.getItem('courseworkPref-' + dtps.classes[dtps.selectedClass].id) == 'moduleStream')) { fluid.screen('moduleStream', dtps.classes[dtps.selectedClass].id); } else { fluid.screen('stream', dtps.classes[dtps.selectedClass].id); }" class="btn stream">
+ <i class="fluid-icon">library_books</i>
+ Coursework
+ </button>
+ <button init="true" onclick="fluid.screen('people', dtps.classes[dtps.selectedClass].id);" class="btn people">
+ <i class="fluid-icon">people</i>
+ People
+ </button>
+ <button init="true" onclick="fluid.screen('discussions', dtps.classes[dtps.selectedClass].id);" class="btn discuss">
+ <i class="fluid-icon">forum</i>
+ Discussions
+ </button>
+ <button init="true" onclick="fluid.screen('pages', dtps.classes[dtps.selectedClass].id);" class="btn pages">
+ <i class="fluid-icon">insert_drive_file</i>
+ Pages
+ </button>
+ <button init="true" onclick="fluid.screen('gradebook', dtps.classes[dtps.selectedClass].id);" class="btn grades">
+ <i class="fluid-icon">assessment</i>
+ ${dtpsLMS.gradebook ? "Grades" : "Gradebook"}
+ </button>
+ </div>
+ </div>
+ </div>
+
+ <!-- Class content area -->
+ <div class="classContent">
+ <div class="spinner"></div>
+ </div>
+
+ <!-- Settings card (its inner HTML is added later) -->
+ <div style="height: 100%; overflow: auto !important;" class="card withnav focus close container settingsCard"></div>
+
+ <!-- Changelog card -->
+ <div style="border-radius: 30px;" class="card focus changelog close container">
+ <i onclick="fluid.cards.close('.card.changelog')" class="fluid-icon close">close</i>
+ <h3>What's new in Power+</h3>
+ <h5>Loading...</h5>
+ </div>
+
+ <!-- General details card for assignments, outcomes, class info, etc. -->
+ <div style="border-radius: 30px;" class="card focus details close container">
+ <i onclick="fluid.cards.close('.card.details')" class="fluid-icon close">close</i>
+ <p>An error occured</p>
+ </div>
+
+ <!-- General iFrame card (with white background) -->
+ <div style="border-radius: 30px; top: 50px; background-color: white; color: black;" class="card focus close iFrameCard container">
+ <i style="color: black !important;" onclick="fluid.cards.close('.card.iFrameCard'); $('#CardIFrame').attr('src', '');" class="fluid-icon close">close</i>
+ <br /><br />
+ <iframe style="width: 100%; height: calc(100vh - 175px); border: none;" id="CardIFrame"></iframe>
+ </div>
+ `);
+
+ $("#dtpsMainSearchBox").on("focus", function () {
+ $("#dtpsSearchResults").show();
+ });
+
+ $("#dtpsMainSearchBox").on("blur", function () {
+ $("#dtpsSearchResults").hide();
+ });
+
+ $("#dtpsMainSearchBox").on("input", function () {
+ dtps.setSearchBox();
+ });
+
+ $(document).on("keydown", "#dtpsMainSearchBox", function (e) {
+ if (e.key == "Enter") {
+ //Validate input and tags
+ var term = $("#dtpsMainSearchBox").val().replace(/(type|class):[a-z]*/gi, "").trim();
+ if ($("#dtpsMainSearchBox").attr("data-search-type") && $("#dtpsMainSearchBox").attr("data-dtps-course")) {
+ fluid.screen("search", term);
+ $("#dtpsMainSearchBox").blur();
+ }
+ }
+ });
+}
+
+/**
+ * Sets the search box text based on the current page or keywords
+ */
+dtps.setSearchBox = function () {
+ var value = $("#dtpsMainSearchBox").val() || "";
+
+ var type = null;
+ var course = dtps.selectedClass == "dash" ? "dash" : dtps.classes[dtps.selectedClass];
+ var icon = null;
+ var error = false;
+ var autoType = null;
+ var autoCourse = dtps.selectedClass == "dash" ? "dash" : dtps.classes[dtps.selectedClass];
+
+ //Get automatic type from selected content
+ if (dtps.selectedContent == "people") type = "people";
+ if (dtps.selectedContent == "discuss") type = "discussions";
+ if (dtps.selectedContent == "pages") type = "pages";
+ if (dtps.selectedContent == "grades") type = "grades";
+ if ((dtps.selectedClass == "dash") || (dtps.selectedContent == "stream") || (dtps.selectedContent == "moduleStream")) type = "coursework";
+ autoType = type;
+
+ //Reuse auto type if on search
+ if (dtps.selectedClass == "search") {
+ type = $("#dtpsMainSearchBox").attr("data-ctx-type");
+ course = $("#dtpsMainSearchBox").attr("data-ctx-course");
+ if (!isNaN(Number(course))) course = dtps.classes[course];
+ }
+
+ //Check for type override from search box
+ if (value.split(" ").includes("type:coursework")) type = "coursework";
+ if (value.split(" ").includes("type:homepage")) type = "homepages";
+ if (value.split(" ").includes("type:page")) type = "pages";
+ if (value.split(" ").includes("type:discussion")) type = "discussions";
+ if (value.split(" ").includes("type:grade")) type = "grades";
+ if (value.split(" ").includes("type:person")) type = "people";
+ if (value.split(" ").includes("type:assignment")) type = "assignments";
+ if (value.split(" ").includes("type:module")) type = "modules";
+ if (value.split(" ").includes("type:announcement")) type = "announcements";
+ if (value.split(" ").includes("type:all")) type = "everything";
+
+ //Get icon from final type
+ if (type == "coursework") icon = "library_books";
+ if (type == "people") icon = "people";
+ if (type == "discussions") icon = "forum";
+ if (type == "pages") icon = "insert_drive_file";
+ if (type == "grades") icon = "assessment";
+ if (type == "assignments") icon = "assignment";
+ if (type == "modules") icon = "view_module";
+ if (type == "homepages") icon = "home";
+ if (type == "announcements") icon = "announcement";
+ if (type == "everything") icon = "warning";
+
+ //Check for course override from search box
+ if (value.includes("class:")) {
+ var partialSubject = value.split("class:")[1].split(" ")[0].toLowerCase();
+ if (partialSubject == "all") {
+ course = "all";
+ } else if (partialSubject) {
+ dtps.classes.forEach(c => {
+ if (c.subject.toLowerCase().includes(partialSubject)) {
+ course = c;
+ }
+ });
+ }
+ }
+
+ //Check if the course supports the type
+ if ((course !== "dash") && (course !== "all")) {
+ if ((type == "pages") && !course.pages) error = true;
+ if ((type == "discussions") && !course.discussions) error = true;
+ if ((type == "modules") && !course.modules) error = true;
+ if ((type == "homepages") && !course.homepage) error = true;
+ if ((type == "people") && !course.people) error = true;
+ }
+
+ if ((course == "dash") || (course == "all")) {
+ $("#dtpsSearchStatus i").text(icon);
+ $("#dtpsSearchStatus span").text("Search " + (type == "everything" ? type : "all " + type));
+ $("#dtpsMainSearchBox").attr("placeholder", "Search " + (type == "everything" ? type : "all " + type));
+ $("#dtpsMainSearchBox").attr("data-dtps-course", "all");
+ $("#dtpsMainSearchBox").attr("data-search-type", type);
+ } else if (error) {
+ $("#dtpsSearchStatus i").text("error");
+ $("#dtpsSearchStatus span").html(`Cannot search for ${type} in <b style="color: ${course.color};">${course.subject}</b>`);
+ $("#dtpsMainSearchBox").attr("placeholder", "Cannot search for " + type + " in " + course.subject);
+ $("#dtpsMainSearchBox").attr("data-dtps-course", "");
+ $("#dtpsMainSearchBox").attr("data-search-type", "");
+ } else if (course || true) {
+ $("#dtpsSearchStatus i").text(icon);
+ $("#dtpsSearchStatus span").html(`Search ${type} in <b style="color: ${course.color};">${course.subject}</b>`);
+ $("#dtpsMainSearchBox").attr("placeholder", "Search " + type + " in " + course.subject);
+ $("#dtpsMainSearchBox").attr("data-dtps-course", course.num);
+ $("#dtpsMainSearchBox").attr("data-search-type", type);
+ }
+
+ //Set auto type
+ if (dtps.selectedClass !== "search") {
+ $("#dtpsMainSearchBox").attr("data-ctx-type", autoType);
+ $("#dtpsMainSearchBox").attr("data-ctx-course", autoCourse == "dash" ? "dash" : autoCourse.num);
+ }
+}
+
+/**
+ * Renders basic content after the user has been loaded
+ */
+dtps.renderLite = function () {
+ //Add hideGrades body class if enabled and preference listener
+ if (fluid.get("pref-hideGrades") == "true") { jQuery('body').addClass('hidegrades'); }
+ document.addEventListener("pref-hideGrades", function (e) {
+ if ((e.detail == "true") || (e.detail == true)) {
+ //hideGrades has been enabled, add class to body to hide grades via CSS
+ jQuery('body').addClass('hidegrades');
+ } else {
+ //hideGrades has been disabled, remove class from body to show grades
+ jQuery('body').removeClass('hidegrades');
+ }
+ });
+
+ //Render settings card
+ var baseHost = new URL(dtps.baseURL).hostname;
+ jQuery(".card.settingsCard").html(/*html*/`
+ <i onclick="fluid.cards.close('.card.settingsCard')" class="fluid-icon close">close</i>
+
+ <div style="position: fixed; height: calc(100% - 100px);" class="sidenav">
+ <div class="title">
+ <img src="${dtps.baseURL + "/icon.svg"}" style="width: 50px;vertical-align: middle;padding: 7px; padding-top: 14px;" />
+ <div style="vertical-align: middle; display: inline-block;">
+ <h5 style="font-weight: bold;display: inline-block;vertical-align: middle;">Power+</h5>
+ <p>${dtps.readableVer + (dtps.unstable ? ` <span style="font-size: 12px; color: red;">(unstable)</span>` : "")}</p>
+ </div>
+ </div>
+
+ <div onclick="$('.abtpage').hide();$('.abtpage.settings').show();" class="item active">
+ <i class="fluid-icon">settings</i> Settings
+ </div>
+ <div onclick="$('.abtpage').hide();$('.abtpage.theme').show();" class="item">
+ <i class="fluid-icon">format_paint</i> Theme
+ </div>
+ ${dtps.remoteConfig.showGradesInSettings ? /*html*/`
+ <div onclick="$('.abtpage').hide();$('.abtpage.grades').show();" class="item">
+ <i class="fluid-icon">assessment</i> Grades
+ </div>
+ ` : ``}
+ <div onclick="$('.abtpage').hide();$('.abtpage.dashboard').show();" class="item">
+ <i class="fluid-icon">dashboard</i> Dashboard
+ </div>
+ ${dtps.env == "dev" ? /*html*/`
+ <div onclick="$('.abtpage').hide();$('.abtpage.debugging').show();" class="item">
+ <i class="fluid-icon">bug_report</i> Debugging
+ </div>
+ <div onclick="$('.abtpage').hide();$('.abtpage.experiments').show();" class="item">
+ <i class="fluid-icon">science</i> Experiments
+ </div>
+ ` : ``}
+ <div onclick="$('.abtpage').hide();$('.abtpage.about').show();" class="item abt">
+ <i class="fluid-icon">info</i> About
+ </div>
+ </div>
+
+ <div style="min-height: 100%" class="content">
+ <div class="abtpage settings">
+ <h5><b>Settings</b></h5>
+
+ <p style="display: none;" id="settingsReloadWarning">You must reload for the changes you've made to take effect</p>
+
+ <br />
+ <p>Sidebar</p>
+
+ <div onclick="fluid.set('pref-hideGrades');" class="switch pref-hideGrades"><span class="head"></span></div>
+ <div class="label"><i class="fluid-icon">visibility_off</i> Hide class grades</div>
+
+ ${dtpsLMS.dtech && !dtps.user.parent ? /*html*/`
+ <br /><br />
+ <div onclick="fluid.set('pref-autoGroupClasses'); dtps.settingsReloadWarning();" class="switch pref-autoGroupClasses active"><span class="head"></span></div>
+ <div class="label"><i class="fluid-icon">sort</i> Automatically group and sort classes</div>
+ ` : ""
+ }
+
+ <br /><br />
+ <p>Classes</p>
+
+ <div onclick="fluid.set('pref-fullNames'); dtps.settingsReloadWarning();" class="switch pref-fullNames"><span class="head"></span></div>
+ <div class="label"><i class="fluid-icon">title</i> Show full class names</div>
+
+ <br /><br />
+ <div onclick="fluid.set('pref-hideClassImages')" class="switch pref-hideClassImages"><span class="head"></span></div>
+ <div class="label"><i class="fluid-icon">image</i> Hide class images</div>
+
+ ${dtpsLMS.dtech ? /*html*/`
+ <br /><br />
+ <p>Assignments</p>
+
+ <div onclick="fluid.set('pref-formatAssignmentContent');" class="switch pref-formatAssignmentContent active"><span class="head"></span></div>
+ <div class="label"><i class="fluid-icon">format_paint</i> Reformat assignment content</div>
+ ` : ""
+ }
+
+ <div id="dtpsPrereleaseTesting" style="${window.localStorage.prereleaseEnabled || (dtps.env == "dev") || window.localStorage.githubRepo || window.localStorage.externalReleaseURL ? "" : "display: none;"}">
+ <br /><br />
+ <p>Prerelease testing</p>
+
+ <div>
+ <div class="btns row small">
+ <button
+ onclick="window.localStorage.setItem('dtpsLoaderPref', 'prod')"
+ class="btn ${!["dev", "github", "external", "local"].includes(window.localStorage.dtpsLoaderPref) ? "active" : ""}">
+ <i class="fluid-icon">label</i> Production
+ </button>
+ <button
+ onclick="window.localStorage.setItem('dtpsLoaderPref', 'dev')"
+ class="btn ${window.localStorage.dtpsLoaderPref == "dev" ? "active" : ""}">
+ <i class="fluid-icon">feedback</i> Dev
+ </button>
+ ${window.localStorage.githubRepo ? /*html*/`
+ <button
+ onclick="window.localStorage.setItem('dtpsLoaderPref', 'github')"
+ class="btn ${window.localStorage.dtpsLoaderPref == "github" ? "active" : ""}">
+ <i class="fluid-icon">account_tree</i> Branch
+ </button>
+ ` : ``}
+ ${window.localStorage.externalReleaseURL ? /*html*/`
+ <button
+ onclick="window.localStorage.setItem('dtpsLoaderPref', 'external')"
+ class="btn ${window.localStorage.dtpsLoaderPref == "external" ? "active" : ""}">
+ <i class="fluid-icon">public</i> External
+ </button>
+ ` : ``}
+ <button
+ onclick="window.localStorage.setItem('dtpsLoaderPref', 'local')"
+ class="btn ${window.localStorage.dtpsLoaderPref == "local" ? "active" : ""}">
+ <i class="fluid-icon">developer_board</i> Local
+ </button>
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+ <div style="display: none;" class="abtpage theme">
+ <h5><b>Theme</b></h5>
+
+ <br />
+
+ <div class="btns row themeSelector"></div>
+ </div>
+
+ <div style="display: none;" class="abtpage grades">
+ <h5><b>Grades</b></h5>
+
+ <br />
+
+ <div>
+ <h6>Estimated GPA: <b id="dtpsGpaText">...</b></h6>
+ <p style="color: var(--secText);"><i>This GPA calculation is unofficial and does not account for honors credit</i></p>
+ </div>
+
+ <br />
+
+ <div id="classGradeBars"></div>
+ </div>
+
+ <div style="display: none;" class="abtpage dashboard">
+ <h5><b>Dashboard</b></h5>
+ <p>You can rearrange the items shown on the dashboard by dragging them below. You might have to reload Power+ for changes to take effect.</p>
+
+ <button onclick="dtps.resetDashboardPrefs();" class="btn small"><i class="fluid-icon">refresh</i> Reset dashboard layout</button>
+
+ <br />
+
+ <div id="leftDashboardColumn" class="dashboardColumn"></div>
+
+ <div id="rightDashboardColumn" class="dashboardColumn"></div>
+ </div>
+
+ ${dtps.env == "dev" ? /*html*/`
+ <div style="display: none;" class="abtpage debugging">
+ <h5><b>Debugging</b></h5>
+ <p>These settings are for development only and might break Power+. Use at your own risk.</p>
+
+ <div>
+ <button onclick="dtps.firstrun()" class="btn small"><i class="fluid-icon">web_asset</i> Show firstrun screen</button>
+ </div>
+
+ <br /><br />
+
+ <h5>Release configuration</h5>
+
+ <button onclick="['dtpsLoaderPref', 'prereleaseEnabled', 'githubRepo', 'externalReleaseURL', 'dtpsLMSOverride'].forEach(k => window.localStorage.removeItem(k)); window.location.reload();" class="btn small"><i class="fluid-icon">cancel</i> Clear release configurations</button>
+ <br /><br />
+
+ <div>
+ <input id="dtpsGithubRepo" value="${window.localStorage.githubRepo || ""}" placeholder="Branch GitHub repo" />
+ <button class="btn small" onclick="window.localStorage.setItem('githubRepo', $('#dtpsGithubRepo').val())"><i class="fluid-icon">save</i> Save</button>
+ </div>
+
+ <div>
+ <input id="dtpsExternalReleaseURL" value="${window.localStorage.externalReleaseURL || ""}" placeholder="External release URL" />
+ <button class="btn small" onclick="window.localStorage.setItem('externalReleaseURL', $('#dtpsExternalReleaseURL').val())"><i class="fluid-icon">save</i> Save</button>
+ </div>
+
+ <div>
+ <input id="dtpsLMSOverride" value="${window.localStorage.dtpsLMSOverride || ""}" placeholder="LMS override" />
+ <button class="btn small" onclick="window.localStorage.setItem('dtpsLMSOverride', $('#dtpsLMSOverride').val())"><i class="fluid-icon">save</i> Save</button>
+ </div>
+
+ <br />
+
+ <h5>Behavior Overrides</h5>
+
+ <br />
+ <div onclick="fluid.set('pref-debuggingGenericGradebook')" class="switch pref-debuggingGenericGradebook"><span class="head"></span></div>
+ <div class="label">Always use the generic gradebook</div>
+
+ <br /><br />
+ <div onclick="fluid.set('pref-debuggingLocalFluidUI')" class="switch pref-debuggingLocalFluidUI"><span class="head"></span></div>
+ <div class="label">Use local Fluid UI</div>
+
+ <br /><br />
+
+ <br /><br />
+ <input type="date" />
+ <br /><br />
+ <input type="color" />
+ </div>
+ <div style="display: none;" class="abtpage experiments">
+ <h5><b>Experiments</b></h5>
+ <p>These settings control how Power+ behaves. Changing these settings may enable unsupported and/or unfinished features that can break Power+. Use at your own risk.</p>
+
+ <button onclick="Object.keys(dtps.remoteConfig).forEach(k => window.localStorage.removeItem('dtpsRemoteConfig-' + k));" class="btn small"><i class="fluid-icon">cancel</i> Clear Overrides</button>
+ <br /><br />
+ ${Object.keys(dtps.remoteConfig).map(k => (`
+ <div>
+ <p>${k} ${window.localStorage.getItem("dtpsRemoteConfig-" + k) ? " <b>(overridden)</b>" : ""}</p>
+ <input value="${dtps.remoteConfig[k]}" placeholder="Value" />
+ <button class="btn small" onclick="window.localStorage.setItem('dtpsRemoteConfig-${k}', $(this).siblings('input').val())"><i class="fluid-icon">save</i> Save</button>
+ </div>
+ `)).join("")}
+ </div>
+ ` : ``}
+
+ <div style="display: none;" class="abtpage about">
+ <h5><b>About</b></h5>
+
+ <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
+ <img src="${dtps.baseURL + "/icon.svg"}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px;" />
+
+ <div style="display: inline-block; vertical-align: middle;">
+ <h4 id="dtpsAboutName" onclick="dtps.classicEntry()" style="font-weight: bold; font-size: 32px; margin-bottom: 0px; user-select: none;">${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
+ <div style="font-size: 16px; margin-top: 5px;">
+ ${dtps.readableVer}
+ <div style="display: inline-block;margin: 0px 5px;font-size: 12px;">${baseHost !== "powerplus.app" ? `(from ${baseHost})` : ""}</div>
+ </div>
+ </div>
+
+ <div style="margin-top: 15px; margin-bottom: 7px;"><a onclick="dtps.changelog();" style="color: var(--lightText); margin: 0px 5px;" href="#"><i class="fluid-icon" style="vertical-align: middle">update</i> Changelog</a>
+ <a onclick="if (window.confirm('Are you sure you want to uninstall Power+? The extension will be removed and all of your Power+ data will be erased. If you use the Power+ bookmarklet, you will have to remove that yourself.')) { document.dispatchEvent(new CustomEvent('extensionData', { detail: 'extensionUninstall' })); window.localStorage.clear(); window.alert('Power+ has been uninstalled. Reload the page to go back to ${dtpsLMS.shortName}.') }" style="color: var(--lightText); margin: 0px 5px; cursor: pointer;"><i class="fluid-icon" style="vertical-align: middle">delete_outline</i> Uninstall</a>
+ <a style="color: var(--lightText); margin: 0px 5px;" href="mailto:[email protected]"><i class="fluid-icon" style="vertical-align: middle">email</i> Contact</a>
+ </div>
+ </div>
+
+ <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
+ <div style="margin-top: 12px;">
+ <img src="${dtps.user.photoURL}" style="height: 50px; margin-right: 10px; vertical-align: middle; border-radius: 50%;" />
+
+ <div style="display: inline-block; vertical-align: middle;">
+ <h4 style="font-weight: bold; font-size: 32px; margin: 0px;">${dtps.user.name} <span style="font-size: 12px; line-height: 0px;">${dtps.user.id}</span></h4>
+ </div>
+ </div>
+
+ <div style="margin-top: 15px; margin-bottom: 7px;">
+ <a style="color: var(--lightText); margin: 0px 5px;" href="/logout"><i class="fluid-icon" style="vertical-align: middle">exit_to_app</i> Logout</a>
+ </div>
+ </div>
+
+ <div class="card" style="padding: 10px 20px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px;">
+ <img src="${dtpsLMS.logo}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px; border-radius: 50%; background: #ee5034;" />
+
+ <div style="display: inline-block; vertical-align: middle;">
+ <h4 style="font-weight: bold; font-size: 32px; margin-bottom: 0px;">${dtpsLMS.name}</h4>
+ ${dtpsLMS.description ? `
+ <div style="font-size: 16px; margin-top: 5px;">${dtpsLMS.description}</div>
+ ` : ``}
+ </div>
+
+ <div style="margin-top: 15px; margin-bottom: 7px;">
+ <a style="color: var(--lightText); margin: 0px 5px;" href="${dtpsLMS.source}"><i class="fluid-icon" style="vertical-align: middle">code</i> LMS integration source code</a>
+ </div>
+ </div>
+
+ <div class="card advancedOptions" style="padding: 8px 16px; box-shadow: none !important; border: 2px solid var(--elements); margin-top: 20px; ${dtps.env == "dev" ? `` : `display: none;`}">
+ <div style="display: inline-block; vertical-align: middle;">
+ <h4 style="font-weight: bold; font-size: 28px; margin-bottom: 0px;">Advanced Options</h4>
+ </div>
+
+ <div style="margin-top: 15px; margin-bottom: 7px;">
+ <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="dtps.clearData();"><i class="fluid-icon" style="vertical-align: middle">refresh</i> Reset Power+</a>
+ <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="if (confirm('Prerelease versions of Power+ are often untested and can break or display incorrect information. Are you sure you want to continue?')) {window.localStorage.prereleaseEnabled = 'true'; $('#dtpsPrereleaseTesting').show(); alert('Prerelease versions can be enabled by going to Settings -> Prerelease testing');}"><i class="fluid-icon" style="vertical-align: middle">feedback</i> Test prerelease versions</a>
+ </div>
+ </div>
+
+ <br />
+ ${dtps.env == "dev" ? `` : `<p style="cursor: pointer; color: var(--secText, gray)" onclick="$('.advancedOptions').show(); $(this).hide();" class="advOp">Show advanced options</p>`}
+
+ <div style="text-align: center; padding: 50px 0px;">
+ <img style="height: 45px; margin-right: 20px; vertical-align: middle;" src="https://cdn.jottocraft.com/images/footerImage.png" />
+ <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
+ <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
+ </div>
+ </div>
+ </div>
+ `);
+
+ //Set profile image
+ jQuery(".profileImage").css("background-image", "url('" + dtps.user.photoURL + "')");
+ jQuery(".profileMenu .name").text(dtps.user.name);
+
+ //Load Fluid UI
+ fluid.onLoad();
+
+ //Render sidebar
+ dtps.showClasses();
+
+ //Remove loading screen styles
+ jQuery("#dtpsNativeOverlay style").remove();
+
+ //Fade out loading screen
+ jQuery("#dtpsNativeOverlay").css("opacity", "0");
+
+ //Remove loading screen after the animation is complete
+ setTimeout(() => jQuery("#dtpsNativeOverlay").remove(), 200);
+}
+
+//Start loading DTPS
+dtps.init();
+
+//LMS Integration documentation -------------------------------------------------------------------------------------
+
+/**
+ * @namespace dtpsLMS
+ * @description Global DTPS LMS integration object. All LMS-related tasks, such as fetching data, are handled by this object. This is always loaded first.
+ * @global
+ * @property {string} name Full LMS name
+ * @property {string} [shortName] Short LMS name
+ * @property {string} legalName Legal name (or names) to show in the "Welcome to Power+" disclaimer
+ * @property {string} [description] A short description of the LMS integration provided
+ * @property {string} logo LMS logo image URL
+ * @property {string} url URL to the LMS' website
+ * @property {string} source URL to the LMS integration's source code
+ * @property {boolean} [dtech] True if this LMS is d.tech
+ * @property {boolean} [institutionSpecific] True if the LMS is designed for a specific institution instead of a broader LMS
+ * @property {boolean} [preferRubricGrades] True if DTPS should prefer rubric grades for assignments
+ * @property {boolean} [genericGradebook] True if DTPS should show the generic gradebook. Ignored if dtpsLMS.gradebook defined.
+ */
+
+/**
+ * @name dtpsLMS.fetchUser
+ * @description [REQUIRED] Fetches data for the current user from the LMS. If the user is not signed in, reject with an object that looks like {action: "login", redirectURL: "..."} to login the user.
+ * @kind function
+ * @return {Promise<User>} A promise which resolves to a User object
+ */
+
+/**
+* @name dtpsLMS.fetchClasses
+* @description [REQUIRED] Fetches class data from the LMS
+* @kind function
+* @param {string} userID The user ID to fetch classes for
+* @return {Promise<Class[]>} A promise which resolves to an array of Class objects
+*/
+
+/**
+* @name dtpsLMS.fetchAssignments
+* @description [REQUIRED] Fetches assignment data for a course from the LMS
+* @kind function
+* @param {string} userID The user ID to fetch assignments for
+* @param {string} classID The class ID to fetch assignments for
+* @return {Promise<Assignment[]>} A promise which resolves to an array of Assignment objects
+*/
+
+/**
+* @name dtpsLMS.fetchModules
+* @description [OPTIONAL] Fetches module data for a course from the LMS
+* @kind function
+* @param {string} userID The user ID to fetch modules for
+* @param {string} classID The class ID to fetch modules for
+* @return {Promise<Module[]>} A promise which resolves to an array of Module objects
+*/
+
+/**
+* @name dtpsLMS.collapseModule
+* @description [OPTIONAL] Collapses a module in the LMS
+* @kind function
+* @param {string} classID The ID of the class
+* @param {string} moduleID The ID of the module to collapse
+* @param {boolean} collapsed True if the module is collapsed, false otherwise
+* @return {Promise} A promise which resolves when the operation is completed
+*/
+
+/**
+* @name dtpsLMS.collapseAllModules
+* @description [OPTIONAL] Collapses all modules in the LMS
+* @kind function
+* @param {string} classID The ID of the class
+* @param {boolean} collapsed True if all modules should be collapsed, false otherwise
+* @return {Promise} A promise which resolves when the operation is completed
+*/
+
+/**
+* @name dtpsLMS.fetchAnnouncements
+* @description [OPTIONAL] Fetches recent announcements for a course from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch announcements for
+* @return {Promise<Announcement[]>} A promise which resolves to an array of Announcement objects
+*/
+
+/**
+* @name dtpsLMS.fetchMeetingURL
+* @description [OPTIONAL] Fetches the videoMeetingURL for a class
+* @kind function
+* @param {string} classID The class ID to get the videoMeetingURL for
+* @return {Promise<string>} A promise which resolves to the videoMeetingURL for the class, or null if the class does not have a videoMeetingURL
+*/
+
+/**
+* @name dtpsLMS.fetchHomepage
+* @description [OPTIONAL] Fetches homepage HTML for a course from the LMS
+* @kind function
+* @param {string} classID The class ID to get the homepage for
+* @return {Promise<string>} A promise which resolves to the HTML for the class homepage
+*/
+
+/**
+* @name dtpsLMS.fetchUsers
+* @description [OPTIONAL] Fetches the users for a course from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch users for
+* @return {Promise<ClassSection[]>} A promise which resolves to an array of sections in this class
+*/
+
+/**
+* @name dtpsLMS.fetchDiscussionThreads
+* @description [OPTIONAL] Fetches discussion threads for a course from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch discussion threads for
+* @return {Promise<PartialDiscussionThread[]>} A promise which resolves to an array of partial Discussion Thread objects
+*/
+
+/**
+* @name dtpsLMS.fetchDiscussionPosts
+* @description [REQUIRED IF dtpsLMS.fetchDiscussionThreads IS IMPLEMENTED] Fetches discussion posts in a thread from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch discussion posts for
+* @param {string} threadID The discussion thread ID to fetch discussion posts for
+* @return {Promise<DiscussionThread>} A promise which resolves to a full discussion thread object
+*/
+
+/**
+* @name dtpsLMS.fetchPages
+* @description [OPTIONAL] Fetches pages for a course from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch pages for
+* @return {Promise<PartialPage[]>} A promise which resolves to an array of partial page objects
+*/
+
+/**
+* @name dtpsLMS.fetchPageContent
+* @description [REQUIRED IF dtpsLMS.fetchPages IS IMPLEMENTED] Fetches content for a page from the LMS
+* @kind function
+* @param {string} classID The class ID to fetch page content for
+* @param {string} pageID The page ID to fetch page content for
+* @return {Promise<Page>} A promise which resolves to a full DTPS page object
+*/
+
+/**
+* @name dtpsLMS.gradebook
+* @description [OPTIONAL] Renders custom gradebook HTML for unique grading systems or for a more tailored experience. The gradebook only shows for classes with a grade and with at least 1 assignment.
+* @kind function
+* @param {Class} course Class to render the gradebook for. If custom grade calculation is enabled (dtpsLMS.calculateGrade), those results can be accessed at course.gradeCalculation.
+* @return {Promise<string>} A promise which resolves to HTML to render for the class gradebook
+*/
+
+/**
+* @name dtpsLMS.gradebookDidRender
+* @description [OPTIONAL] Called after the HTML returned by dtpsLMS.gradebook has rendered. Runs any initialization needed for the gradebook, such as enabling interactive elements or what-if grades.
+* @kind function
+* @param {Class} course Class the gradebook was rendered for
+*/
+
+/**
+* @name dtpsLMS.calculateGrade
+* @description [OPTIONAL] Calculates class grades with a custom grade calculation formula. Used for unique grading systems.
+* @kind function
+* @param {Class} course Class to calculate grades for [DO NOT USE COURSE.ASSIGNMENTS to access assignments for grade calculation. Use the assignments parameter instead.]
+* @param {Assignment[]} assignments Assignments used for grade calculation. Use this instead of course.assignments for hypothetical/what-if grade calculation.
+* @return {undefined|object} The letter grade should be returned in the "letter" property as a string and the percentage in the "grade" property as a number. Other custom properties can be set if they need to be accessed by dtpsLMS.gradebook. Return undefined if there is no grade for the class.
+*/
+
+/**
+* @name dtpsLMS.isUsualDueDate
+* @description [OPTIONAL, INSTITUTION ONLY] This function returns true if the due date provided is usual/expected and false if the due date is unusual/expected. If the due date is unusual, it is shown in bold in the UI. For institutions where there is a pattern/standard for due dates between classes.
+* @kind function
+* @param {Date} date The due date to check
+* @return {boolean} True if the due date is usual, false if the due date is unusual/unexpected.
+*/
+
+/**
+* @name dtpsLMS.updateAssignments
+* @description [OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override assignment data returned by the LMS.
+* @kind function
+* @param {Assignment[]} assignments Original assignments array
+* @return {Promise<Assignment[]>} A promise that resolves to the updated assignments array
+*/
+
+/**
+* @name dtpsLMS.updateClasses
+* @description [OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override class data returned by the LMS.
+* @kind function
+* @param {Class[]} classes Original classes array
+* @return {Promise<Class[]>} A promise that resolves to the updated classes array
+*/
+
+//Type definitions -------------------------------------------------------------------------------------
+
+/**
+ * @typedef {string|Date} Date
+ * @description A date string recognized by {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse|Date.parse} or an actual {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date|Date} object
+ */
+
+/**
+ * @typedef {Object} User
+ * @description Defines user objects in DTPS
+ * @property {string} name User name
+ * @property {string} id User ID
+ * @property {string} photoURL User photo URL
+ * @property {string} url [ONLY FOR DTPSLMS.FETCHUSERS] The URL to this user's profile. Only used when displaying users in the people tab.
+ * @property {User[]} [children] [ONLY FOR DTPS.USER] Array of child users. If this is defined, the user is treated as a parent account. Sub-children are not allowed.
+ * @property {boolean} parent [ONLY FOR DTPS.USER] Automatically managed by DTPS. True if the user is a parent account.
+ */
+
+/**
+* @typedef {Object} Class
+* @description Defines class objects in DTPS
+* @property {string} name Name of the class
+* @property {string} id Class ID used by Power+
+* @property {string} lmsID Class ID used for LMS API calls
+* @property {string} userID The ID of the user this class is associated with (from the parameter of dtpsLMS.fetchClasses)
+* @property {number} num Index of the class in the dtps.classes array
+* @property {string} subject Class subject
+* @property {ClassSection[]|boolean} [people] Users in this class. True if the class supports the "People" tab, but not yet loaded. If this is true dtpsLMS.fetchUsers must be implemented.
+* @property {string} [icon] The icon to show with this class
+* @property {string} [group] The name of the group that this class is in
+* @property {number|string} [period] The period or section the user has this class at
+* @property {Date} [endDate] The end date for this course
+* @property {Assignment[]} assignments Class assignments. Assume assignments are still loading if this is undefined. The class has no assignments if this is an empty array. Loaded in dtps.init.
+* @property {Module[]|boolean} [modules] Class modules. Assume this class supports the modules feature, but is not yet loaded, if this is true and that the class has no modules if this is an empty array. For LMSs that do not support modules, either keep it undefined or set it to false.
+* @property {DiscussionThread[]|boolean} [discussions] Class discussion threads. Assume this class supports discussions, but not yet loaded, if this is true and that the class has no threads if this is an empty array. For LMSs that do not support discussions, either keep it undefined or set it to false.
+* @property {Page[]|boolean} [pages] Class pages. Assume this class supports the pages feature, but not yet loaded, if true and that the class has no pages if this is an empty array. For LMSs that do not support pages, either keep it undefined or set it to false.
+* @property {string} [newDiscussionThreadURL] A URL the user can visit to create a new discussion thread in this class
+* @property {boolean} [homepage] True if the class has a homepage. If a class has a homepage, dtpsLMS.fetchHomepage must be implemented.
+* @property {string} [term] Class term
+* @property {string} [color] Class color
+* @property {number} [grade] Current percentage grade in the class
+* @property {string} [letter] Current letter grade in the class
+* @property {string} [previousLetter] Automatically managed by DTPS. The previous letter grade in this class, based on local grade history.
+* @property {string} [image] URL to the class background image
+* @property {User} [teacher] Class teacher. If the class has multiple teachers, this is the primary teacher.
+* @property {boolean} [hasGradebook] Automatically managed by DTPS. True if the class should show the gradebook tab.
+* @property {object} [gradeCalculation] Automatically managed by DTPS. If custom grade calculation is implemented, this will be the results from custom grade calculation returned by dtpsLMS.calculateGrade.
+* @property {string} [videoMeetingURL] The URL used to join this class' online meeting. If dtpsLMS.fetchMeetingURL is implemented, DTPS will use it to get the meeting URL if this property is undefined. If this property is null, DTPS will not call dtpsLMS.fetchMeeting URL for the class.
+*/
diff --git a/scripts/lms/canvas.js b/scripts/lms/canvas.js
index 5aa9069..ac75727 100644
--- a/scripts/lms/canvas.js
+++ b/scripts/lms/canvas.js
@@ -1,664 +1,664 @@
-/**
- * @file DTPS Canvas LMS Integration
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- *
- * JSDoc documentation for these LMS functions can be found near the end of core.js
- */
-
-//DTPS LMS configuration for Canvas
-var dtpsLMS = {
- name: "Canvas LMS",
- shortName: "Canvas",
- legalName: "Canvas LMS or Instructure Inc.",
- description: "Power+ integration for Canvas LMS",
- url: "https://www.instructure.com/canvas/",
- logo: "https://i.imgur.com/rGjNVoc.png",
- source: "https://github.com/jottocraft/dtps/blob/main/scripts/lms/canvas.js",
- genericGradebook: true
-};
-
-
-/**
- * Common headers used for Canvas web requests.
- * This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.
- */
-dtpsLMS.commonHeaders = { Accept: "application/json+canvas-string-ids, application/json" };
-
-/**
- * List of teachers from dtpsLMS.fetchClasses for use in other methods
- * This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.
- */
-dtpsLMS.teacherCache = {};
-
-//Fetch userdata from Canvas
-dtpsLMS.fetchUser = function () {
- return new Promise(function (resolve, reject) {
- if (!window.ENV || !window.ENV.current_user.id) reject({ action: "login", redirectURL: "/?dtpsLogin=true" });
-
- var user = {
- name: window.ENV.current_user.display_name,
- id: window.ENV.current_user.id,
- photoURL: ENV.current_user.avatar_image_url
- };
-
- if (window.ENV.current_user_roles.includes("observer")) {
- fetch("/api/v1/users/self/observees?include[]=avatar_url", { headers: dtpsLMS.commonHeaders }).then(response => {
- return response.json();
- }).then(childrenData => {
- if (childrenData && childrenData.length) {
- //Parent account
- user.children = childrenData.map(child => {
- return {
- name: child.name.split(" ")[0],
- id: child.id,
- photoURL: child.avatar_url
- }
- });
- }
-
- resolve(user);
- }).catch(reject);
- } else {
- resolve(user);
- }
- })
-}
-
-//Fetch class data from Canvas
-dtpsLMS.fetchClasses = function (userID) {
- return new Promise(function (resolve, reject) {
- Promise.all([
- fetch("/api/v1/users/" + dtps.user.id + "/colors", { headers: dtpsLMS.commonHeaders }),
- fetch("/api/v1/users/" + userID + "/dashboard_positions", { headers: dtpsLMS.commonHeaders }),
- fetch("/api/v1/users/" + userID + "/courses?per_page=100&enrollment_state=active&include[]=term&include[]=total_scores&include[]=account&include[]=teachers&include[]=course_image&include[]=tabs&include[]=sections", { headers: dtpsLMS.commonHeaders })
- ]).then(responses => {
- return Promise.all(responses.map(r => r.json()));
- }).then(data => {
- var [colorData, dashboardData, courseData] = data;
- var courses = [];
-
- //Add courses from canvas to courses array as a DTPS course object
- courseData.forEach((course, index) => {
- var dtpsCourse = {
- name: course.course_code,
- id: course.id,
- lmsID: course.id,
- people: !dtps.user.parent,
- userID: userID,
- period: course.sections && course.sections[0] && (course.sections.find(section => /[0-9](?=\(A)/.test(section.name)) || course.sections[0]).name,
- subject: window.localStorage["pref-fullNames"] == "true" ? course.course_code : course.course_code.split(" - ")[0],
- homepage: course.default_view == "wiki",
- term: course.course_code.split(" - ")[1],
- color: colorData.custom_colors["course_" + course.id],
- grade: course.enrollments[0].computed_current_score,
- letter: course.enrollments[0].computed_current_grade,
- image: course.image_download_url,
- newDiscussionThreadURL: '/courses/' + course.id + '/discussion_topics/new',
- pages: course.tabs.map(tab => tab.id).includes("pages"),
- modules: course.tabs.map(tab => tab.id).includes("modules"),
- discussions: true || course.tabs.map(tab => tab.id).includes("discussions"),
- endDate: course.end_at
- };
-
- //Save teachers in cache
- dtpsLMS.teacherCache[course.id] = course.teachers;
-
- if (course.teachers[0]) {
- dtpsCourse.teacher = {
- name: course.teachers[0] && course.teachers[0].display_name,
- id: course.teachers[0] && course.teachers[0].id,
- photoURL: course.teachers[0] && course.teachers[0].avatar_image_url
- };
- }
-
- courses.push(dtpsCourse);
- });
-
- //Sort courses array
- courses.sort(function (a, b) {
- var keyA = dashboardData.dashboard_positions["course_" + a.id],
- keyB = dashboardData.dashboard_positions["course_" + b.id];
-
- if (keyA < keyB) return -1;
- if (keyA > keyB) return 1;
- return 0;
- });
-
- resolve(courses);
- }).catch(reject);
- })
-}
-
-//Fetches assignment data from Canvas
-dtpsLMS.fetchAssignments = function (userID, classID) {
- return new Promise(function (resolve, reject) {
- Promise.all([
- fetch("/api/v1/courses/" + classID + "/students/submissions?include[]=rubric_assessment&include[]=submission_comments&per_page=100&student_ids[]=" + userID, { headers: dtpsLMS.commonHeaders }),
- fetch("/api/v1/users/" + userID + "/courses/" + classID + "/assignments?per_page=100", { headers: dtpsLMS.commonHeaders })
- ]).then(responses => {
- return Promise.all(responses.map(r => r.json()));
- }).then(data => {
- var [submissionData, assignmentData] = data;
-
- //All fetches have been completed successfully
- var assignments = [];
-
- //Add assignments from canvas to assignments array as a DTPS assignment object
- assignmentData.forEach((assignment, index) => {
- //Define dtpsAssignment
- var dtpsAssignment = {
- title: assignment.name,
- body: assignment.description,
- id: assignment.id,
- dueAt: assignment.due_at,
- url: assignment.html_url,
- locked: assignment.locked_for_user,
- publishedAt: assignment.created_at,
- value: assignment.points_possible
- };
-
- //Save score names to an array temporarily
- //This is because the scoreNames can only be found in the rubric data from Canvas
- //And we don't know which name to use until the outcome score data is processed
- var temporaryScoreNames = {};
-
- //Add rubric data from Canvas to the dtpsAssignment
- if (assignment.rubric) {
- assignment.rubric.forEach(canvasRubric => {
- //Add rubric array to assignment if it doesn't exist yet
- if (!dtpsAssignment.rubric) dtpsAssignment.rubric = [];
-
- dtpsAssignment.rubric.push({
- title: canvasRubric.description,
- description: canvasRubric.long_description,
- id: canvasRubric.id,
- value: canvasRubric.points,
- outcome: canvasRubric.outcome_id,
- assignmentTitle: assignment.name,
- assignmentID: assignment.id
- });
-
- temporaryScoreNames[canvasRubric.id] = {};
- canvasRubric.ratings.forEach(canvasRating => {
- temporaryScoreNames[canvasRubric.id][canvasRating.points] = canvasRating.description;
- });
- })
- }
-
- //Add submission data from Canvas to the dtpsAssignment
- submissionData.forEach(submission => {
- if (submission.assignment_id == assignment.id) {
- //Add scores from this submission to the rubric
- if (submission.rubric_assessment) {
- dtpsAssignment.rubric.forEach(rubric => {
- if (submission.rubric_assessment[rubric.id]) {
- rubric.score = submission.rubric_assessment[rubric.id].points;
- rubric.scoreName = temporaryScoreNames[rubric.id][rubric.score];
- }
- });
- }
-
- //Check for turned in, late, missing, gradedAt, and feedback
- dtpsAssignment.turnedIn = submission.submission_type !== null;
- dtpsAssignment.late = submission.late;
- dtpsAssignment.missing = submission.missing;
- dtpsAssignment.gradedAt = submission.graded_at;
- dtpsAssignment.grade = submission.score;
- var letter = submission.grade;
- if (letter == "complete") letter = "✔️";
- if (letter == "incomplete") letter = "❌";
- if (isNaN(letter)) dtpsAssignment.letter = letter; //letter cannot be a number
-
- //Check for submission comments
- if (submission.submission_comments) {
- //Add feedback array to assignment
- dtpsAssignment.feedback = [];
-
- //Add each comment to feedback array
- submission.submission_comments.forEach(comment => {
- var feedback = {
- comment: comment.comment
- };
-
- //Add author to feedback if found
- if (comment.author) {
- feedback.author = {
- name: comment.author.display_name,
- id: comment.author.id,
- photoURL: comment.author.avatar_image_url
- }
- }
-
- dtpsAssignment.feedback.push(feedback)
- });
- }
- }
- });
-
- //Add assignment to results array
- assignments.push(dtpsAssignment);
- });
-
- resolve(assignments);
- }).catch(reject);
- });
-}
-
-//Fetches modules data from Canvas
-dtpsLMS.fetchModules = function (userID, classID) {
- return new Promise(function (resolve, reject) {
- Promise.all([
- fetch("/api/v1/courses/" + classID + "/modules?include[]=items&include[]=content_details", { headers: dtpsLMS.commonHeaders }),
- fetch("/courses/" + classID + "/modules/progressions", { headers: dtpsLMS.commonHeaders })
- ]).then(responses => {
- return Promise.all(responses.map(r => r.json()));
- }).then(data => {
- var [modulesData, progressionData] = data;
-
- //Get collapsed modules from progression data
- var collapsedModules = {};
-
- //Loop over progression data
- progressionData.forEach(prog => {
- //Store collapsed state
- collapsedModules[prog.context_module_progression.context_module_id] = prog.context_module_progression.collapsed;
- })
-
- //Parse data from Canvas
- var dtpsModules = modulesData.map(module => {
- //Create module items array
- var moduleItems = [];
-
- //Add module items to array
- module.items.forEach(item => {
- if (item.type.toUpperCase() == "ASSIGNMENT") {
- moduleItems.push({
- type: "assignment",
- title: item.title,
- id: item.content_id,
- indent: item.indent,
- url: item.html_url,
- completed: item.completion_requirement && item.completion_requirement.completed
- })
- } else if (item.type.toUpperCase() == "PAGE") {
- moduleItems.push({
- type: "page",
- title: item.title,
- id: item.page_url,
- indent: item.indent,
- url: item.html_url,
- completed: item.completion_requirement && item.completion_requirement.completed
- })
- } else if (item.type.toUpperCase() == "DISCUSSION") {
- moduleItems.push({
- type: "discussion",
- title: item.title,
- id: item.content_id,
- indent: item.indent,
- url: item.html_url,
- completed: item.completion_requirement && item.completion_requirement.completed
- })
- } else if (item.type.toUpperCase() == "EXTERNALURL") {
- moduleItems.push({
- type: "url",
- title: item.title,
- url: item.external_url,
- indent: item.indent,
- completed: item.completion_requirement && item.completion_requirement.completed
- })
- } else if (item.type.toUpperCase() == "EXTERNALTOOL") {
- moduleItems.push({
- type: "embed",
- title: item.title,
- url: item.html_url,
- indent: item.indent,
- completed: item.completion_requirement && item.completion_requirement.completed
- });
- } else if (item.type.toUpperCase() == "SUBHEADER") {
- moduleItems.push({
- type: "header",
- title: item.title,
- indent: item.indent,
- completed: item.completion_requirement && item.completion_requirement.completed
- })
- }
- })
-
- return {
- id: module.id,
- title: module.name,
- collapsed: collapsedModules[module.id] || false,
- items: moduleItems
- }
- })
-
- //Resolve with module data
- resolve(dtpsModules);
- }).catch(reject);
- });
-}
-
-//Collapses a module in Canvas
-dtpsLMS.collapseModule = function (classID, modID, collapsed) {
- return fetch("/courses/" + classID + "/modules/" + modID + "/collapse", {
- method: "POST",
- headers: {
- "Accept": "application/json, text/javascript, application/json+canvas-string-ids, */*; q=0.01",
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- "X-CSRF-Token": decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
- },
- body: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
- });
-}
-
-//Collapses all modules in Canvas
-dtpsLMS.collapseAllModules = function (classID, collapsed) {
- return fetch("/courses/" + classID + "/collapse_all_modules", {
- method: "POST",
- headers: {
- "Accept": "application/json, text/javascript, application/json+canvas-string-ids, */*; q=0.01",
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- "X-CSRF-Token": decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
- },
- body: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
- });
-}
-
-//Fetches announcement data from Canvas
-dtpsLMS.fetchAnnouncements = function (classID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/announcements?context_codes[]=course_" + classID, { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- var dtpsAnnouncements = data.map(function (announcement) {
- return {
- title: announcement.title,
- postedAt: announcement.created_at,
- body: announcement.message,
- url: announcement.html_url
- }
- });
-
- resolve(dtpsAnnouncements);
- }).catch(reject);
- });
-}
-
-//Fetches user data from Canvas
-dtpsLMS.fetchUsers = function (classID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/sections?include[]=avatar_url&include[]=students&per_page=99", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- var teachers = dtpsLMS.teacherCache[classID];
- var sections = [{
- title: "Teachers",
- id: "lms.dtps.canvas-teachers",
- users: []
- }];
-
- teachers.forEach(teacher => {
- sections[0].users.push({
- name: teacher.display_name,
- id: teacher.id,
- photoURL: teacher.avatar_image_url,
- url: "/courses/" + classID + "/users/" + teacher.id
- });
- });
-
- data.forEach(section => {
- if (!section.students) return;
- var users = [];
- section.students.forEach(student => {
- users.push({
- name: student.short_name,
- id: student.id,
- photoURL: student.avatar_url,
- url: "/courses/" + classID + "/users/" + student.id
- });
- });
- var dtechMatch = section.name.match(/[0-9](?=\(A)/);
- if (dtpsLMS.dtech && dtechMatch) {
- section.name = dtechMatch[0] == 7 ? "@d.tech" : "Period " + dtechMatch[0];
- }
- sections.push({
- title: section.name,
- id: section.id,
- users
- });
- });
- resolve(sections);
- }).catch(reject);
- });
-}
-
-//Fetches homepage data from Canvas
-dtpsLMS.fetchHomepage = function (classID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/front_page", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- resolve(data.body);
- }).catch(reject);
- });
-}
-
-//Fetches discussion thread data from Canvas
-dtpsLMS.fetchDiscussionThreads = function (classID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/discussion_topics", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- var dtpsDiscussionThreads = data.map(function (thread) {
- return {
- title: thread.title,
- id: thread.id,
- locked: thread.locked_for_user
- }
- });
-
- resolve(dtpsDiscussionThreads);
- }).catch(reject);
- })
-}
-
-//Fetches discussion thread posts from Canvas
-dtpsLMS.fetchDiscussionPosts = function (classID, threadID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(threadData => {
- //Check if this discussion is a group discussion
- if (threadData.group_topic_children && threadData.group_topic_children.length) {
- //This discussion is probably a group discussion, check groups, then fetch posts
- fetch("/api/v1/courses/" + classID + "/groups?only_own_groups=true", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(groupData => {
- //Get array of group IDs
- var myGroups = groupData.map(group => group.id);
-
- //Set default group and discussion ID variables
- var groupID = null;
- var groupDiscussionID = null;
-
- //Check every group this discussion has and see if one of them is in myGroups, set that group as the group to fetch posts for
- threadData.group_topic_children.forEach(group => {
- if (myGroups.includes(group.group_id)) {
- groupID = group.group_id;
- groupDiscussionID = group.id;
- }
- });
-
- if (!groupID || !groupDiscussionID) {
- //Couldn't find a group match, fetch class discussion
- fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
- parseResponse(responsesData, "/courses/" + classID + "/discussion_topics/" + threadID);
- });
- } else {
- //Group match found, fetch group discussion
- fetch("/api/v1/groups/" + groupID + "/discussion_topics/" + groupDiscussionID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
- parseResponse(responsesData, "/groups/" + groupID + "/discussion_topics/" + groupDiscussionID);
- });
- }
- });
- } else {
- //Not a group discussion, directly fetch posts
- fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
- parseResponse(responsesData, "/courses/" + classID + "/discussion_topics/" + threadID);
- });
- }
-
-
- //This function handles the response from Canavs and returns the data to DTPS
- //BaseURL is the baseURL of the thread, since this might be different for group discussions
- function parseResponse(responsesData, baseURL) {
- //Define discussions post array
- var dtpsDiscussionPosts = [];
-
- //Define the initial post
- var initialPost = {
- id: threadID,
- body: threadData.message,
- postedAt: threadData.created_at,
- replyURL: baseURL
- };
-
- //Check for author
- if (threadData.author && threadData.author.display_name) {
- initialPost.author = {
- name: threadData.author.display_name,
- id: threadData.author.id,
- photoURL: threadData.author.avatar_image_url
- };
- }
-
- //Add initial post to array
- dtpsDiscussionPosts.push(initialPost);
-
- if (responsesData.view) {
- //Get thread author information
- var people = {};
- if (responsesData.participants) {
- responsesData.participants.forEach(participant => {
- people[participant.id] = participant;
- })
- }
-
- //If there are posts found from the second request, add those as well
- responsesData.view.forEach(function (post) {
- if (!post.deleted) {
- var replies = [];
-
- //Get replies for this post
- if (post.replies) {
- //If this post has replies, flatten them into a single array
- function addReplies(arr, depth) {
- //Loop over replies to add
- arr.forEach(reply => {
- //Add this reply to the array
- if (!reply.deleted) {
- //Define reply object
- var dtpsReply = {
- id: reply.id,
- body: reply.message,
- postedAt: reply.created_at,
- replyURL: baseURL + "/entry-" + reply.id,
- depth: depth
- };
-
- //Check for reply author
- if (people[reply.user_id]) {
- dtpsReply.author = {
- name: people[reply.user_id].display_name,
- id: reply.user_id,
- photoURL: people[reply.user_id].avatar_image_url
- }
- }
-
- //Add reply to flattened array
- replies.push(dtpsReply);
- }
-
- //Add nested replies to array
- if (reply.replies) addReplies(reply.replies, depth + 1);
- });
- }
-
- addReplies(post.replies, 0);
- }
-
- //Define post object
- var dtpsPost = {
- id: post.id,
- body: post.message,
- postedAt: post.created_at,
- replies: replies,
- replyURL: baseURL + "/entry-" + post.id
- };
-
- //Check for post author
- if (people[post.user_id]) {
- dtpsPost.author = {
- name: people[post.user_id].display_name,
- id: post.user_id,
- photoURL: people[post.user_id].avatar_image_url
- }
- }
-
- //Add post to array
- dtpsDiscussionPosts.push(dtpsPost);
- }
- });
- }
-
- resolve({
- title: threadData.title,
- id: threadData.id,
- locked: threadData.locked_for_user,
- posts: dtpsDiscussionPosts
- });
- }
- }).catch(reject);
- });
-}
-
-//Fetches pages list data from Canvas
-dtpsLMS.fetchPages = function (classID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/pages?per_page=100", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- var dtpsPages = data.map(function (page) {
- var dtpsPage = {
- title: page.title,
- id: page.url
- };
-
- return dtpsPage;
- });
-
- resolve(dtpsPages);
- }).catch(reject);
- })
-}
-
-//Fetches pages list data from Canvas
-dtpsLMS.fetchPageContent = function (classID, pageID) {
- return new Promise(function (resolve, reject) {
- fetch("/api/v1/courses/" + classID + "/pages/" + pageID, { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
- //Resolve with full page object
- var dtpsPage = {
- title: data.title,
- id: data.url,
- updatedAt: data.updated_at,
- content: data.body
- };
-
- //Check for page author
- if (data.last_edited_by) {
- dtpsPage.author = {
- name: data.last_edited_by.display_name,
- id: data.last_edited_by.id,
- photoURL: data.last_edited_by.avatar_image_url
- }
- }
-
- resolve(dtpsPage);
- }).catch(reject);
- })
-}
-
-//Get baseURL from the URL of this script
-var baseURL = document.currentScript.src.split("/scripts/lms/canvas.js")[0];
-
-//Load Power+
+/**
+ * @file DTPS Canvas LMS Integration
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ *
+ * JSDoc documentation for these LMS functions can be found near the end of core.js
+ */
+
+//DTPS LMS configuration for Canvas
+var dtpsLMS = {
+ name: "Canvas LMS",
+ shortName: "Canvas",
+ legalName: "Canvas LMS or Instructure Inc.",
+ description: "Power+ integration for Canvas LMS",
+ url: "https://www.instructure.com/canvas/",
+ logo: "https://i.imgur.com/rGjNVoc.png",
+ source: "https://github.com/jottocraft/dtps/blob/main/scripts/lms/canvas.js",
+ genericGradebook: true
+};
+
+
+/**
+ * Common headers used for Canvas web requests.
+ * This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.
+ */
+dtpsLMS.commonHeaders = { Accept: "application/json+canvas-string-ids, application/json" };
+
+/**
+ * List of teachers from dtpsLMS.fetchClasses for use in other methods
+ * This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.
+ */
+dtpsLMS.teacherCache = {};
+
+//Fetch userdata from Canvas
+dtpsLMS.fetchUser = function () {
+ return new Promise(function (resolve, reject) {
+ if (!window.ENV || !window.ENV.current_user.id) reject({ action: "login", redirectURL: "/?dtpsLogin=true" });
+
+ var user = {
+ name: window.ENV.current_user.display_name,
+ id: window.ENV.current_user.id,
+ photoURL: ENV.current_user.avatar_image_url
+ };
+
+ if (window.ENV.current_user_roles.includes("observer")) {
+ fetch("/api/v1/users/self/observees?include[]=avatar_url", { headers: dtpsLMS.commonHeaders }).then(response => {
+ return response.json();
+ }).then(childrenData => {
+ if (childrenData && childrenData.length) {
+ //Parent account
+ user.children = childrenData.map(child => {
+ return {
+ name: child.name.split(" ")[0],
+ id: child.id,
+ photoURL: child.avatar_url
+ }
+ });
+ }
+
+ resolve(user);
+ }).catch(reject);
+ } else {
+ resolve(user);
+ }
+ })
+}
+
+//Fetch class data from Canvas
+dtpsLMS.fetchClasses = function (userID) {
+ return new Promise(function (resolve, reject) {
+ Promise.all([
+ fetch("/api/v1/users/" + dtps.user.id + "/colors", { headers: dtpsLMS.commonHeaders }),
+ fetch("/api/v1/users/" + userID + "/dashboard_positions", { headers: dtpsLMS.commonHeaders }),
+ fetch("/api/v1/users/" + userID + "/courses?per_page=100&enrollment_state=active&include[]=term&include[]=total_scores&include[]=account&include[]=teachers&include[]=course_image&include[]=tabs&include[]=sections", { headers: dtpsLMS.commonHeaders })
+ ]).then(responses => {
+ return Promise.all(responses.map(r => r.json()));
+ }).then(data => {
+ var [colorData, dashboardData, courseData] = data;
+ var courses = [];
+
+ //Add courses from canvas to courses array as a DTPS course object
+ courseData.forEach((course, index) => {
+ var dtpsCourse = {
+ name: course.course_code,
+ id: course.id,
+ lmsID: course.id,
+ people: !dtps.user.parent,
+ userID: userID,
+ period: course.sections && course.sections[0] && (course.sections.find(section => /[0-9](?=\(A)/.test(section.name)) || course.sections[0]).name,
+ subject: window.localStorage["pref-fullNames"] == "true" ? course.course_code : course.course_code.split(" - ")[0],
+ homepage: course.default_view == "wiki",
+ term: course.course_code.split(" - ")[1],
+ color: colorData.custom_colors["course_" + course.id],
+ grade: course.enrollments[0].computed_current_score,
+ letter: course.enrollments[0].computed_current_grade,
+ image: course.image_download_url,
+ newDiscussionThreadURL: '/courses/' + course.id + '/discussion_topics/new',
+ pages: course.tabs.map(tab => tab.id).includes("pages"),
+ modules: course.tabs.map(tab => tab.id).includes("modules"),
+ discussions: true || course.tabs.map(tab => tab.id).includes("discussions"),
+ endDate: course.end_at
+ };
+
+ //Save teachers in cache
+ dtpsLMS.teacherCache[course.id] = course.teachers;
+
+ if (course.teachers[0]) {
+ dtpsCourse.teacher = {
+ name: course.teachers[0] && course.teachers[0].display_name,
+ id: course.teachers[0] && course.teachers[0].id,
+ photoURL: course.teachers[0] && course.teachers[0].avatar_image_url
+ };
+ }
+
+ courses.push(dtpsCourse);
+ });
+
+ //Sort courses array
+ courses.sort(function (a, b) {
+ var keyA = dashboardData.dashboard_positions["course_" + a.id],
+ keyB = dashboardData.dashboard_positions["course_" + b.id];
+
+ if (keyA < keyB) return -1;
+ if (keyA > keyB) return 1;
+ return 0;
+ });
+
+ resolve(courses);
+ }).catch(reject);
+ })
+}
+
+//Fetches assignment data from Canvas
+dtpsLMS.fetchAssignments = function (userID, classID) {
+ return new Promise(function (resolve, reject) {
+ Promise.all([
+ fetch("/api/v1/courses/" + classID + "/students/submissions?include[]=rubric_assessment&include[]=submission_comments&per_page=100&student_ids[]=" + userID, { headers: dtpsLMS.commonHeaders }),
+ fetch("/api/v1/users/" + userID + "/courses/" + classID + "/assignments?per_page=100", { headers: dtpsLMS.commonHeaders })
+ ]).then(responses => {
+ return Promise.all(responses.map(r => r.json()));
+ }).then(data => {
+ var [submissionData, assignmentData] = data;
+
+ //All fetches have been completed successfully
+ var assignments = [];
+
+ //Add assignments from canvas to assignments array as a DTPS assignment object
+ assignmentData.forEach((assignment, index) => {
+ //Define dtpsAssignment
+ var dtpsAssignment = {
+ title: assignment.name,
+ body: assignment.description,
+ id: assignment.id,
+ dueAt: assignment.due_at,
+ url: assignment.html_url,
+ locked: assignment.locked_for_user,
+ publishedAt: assignment.created_at,
+ value: assignment.points_possible
+ };
+
+ //Save score names to an array temporarily
+ //This is because the scoreNames can only be found in the rubric data from Canvas
+ //And we don't know which name to use until the outcome score data is processed
+ var temporaryScoreNames = {};
+
+ //Add rubric data from Canvas to the dtpsAssignment
+ if (assignment.rubric) {
+ assignment.rubric.forEach(canvasRubric => {
+ //Add rubric array to assignment if it doesn't exist yet
+ if (!dtpsAssignment.rubric) dtpsAssignment.rubric = [];
+
+ dtpsAssignment.rubric.push({
+ title: canvasRubric.description,
+ description: canvasRubric.long_description,
+ id: canvasRubric.id,
+ value: canvasRubric.points,
+ outcome: canvasRubric.outcome_id,
+ assignmentTitle: assignment.name,
+ assignmentID: assignment.id
+ });
+
+ temporaryScoreNames[canvasRubric.id] = {};
+ canvasRubric.ratings.forEach(canvasRating => {
+ temporaryScoreNames[canvasRubric.id][canvasRating.points] = canvasRating.description;
+ });
+ })
+ }
+
+ //Add submission data from Canvas to the dtpsAssignment
+ submissionData.forEach(submission => {
+ if (submission.assignment_id == assignment.id) {
+ //Add scores from this submission to the rubric
+ if (submission.rubric_assessment) {
+ dtpsAssignment.rubric.forEach(rubric => {
+ if (submission.rubric_assessment[rubric.id]) {
+ rubric.score = submission.rubric_assessment[rubric.id].points;
+ rubric.scoreName = temporaryScoreNames[rubric.id][rubric.score];
+ }
+ });
+ }
+
+ //Check for turned in, late, missing, gradedAt, and feedback
+ dtpsAssignment.turnedIn = submission.submission_type !== null;
+ dtpsAssignment.late = submission.late;
+ dtpsAssignment.missing = submission.missing;
+ dtpsAssignment.gradedAt = submission.graded_at;
+ dtpsAssignment.grade = submission.score;
+ var letter = submission.grade;
+ if (letter == "complete") letter = "✔️";
+ if (letter == "incomplete") letter = "❌";
+ if (isNaN(letter)) dtpsAssignment.letter = letter; //letter cannot be a number
+
+ //Check for submission comments
+ if (submission.submission_comments) {
+ //Add feedback array to assignment
+ dtpsAssignment.feedback = [];
+
+ //Add each comment to feedback array
+ submission.submission_comments.forEach(comment => {
+ var feedback = {
+ comment: comment.comment
+ };
+
+ //Add author to feedback if found
+ if (comment.author) {
+ feedback.author = {
+ name: comment.author.display_name,
+ id: comment.author.id,
+ photoURL: comment.author.avatar_image_url
+ }
+ }
+
+ dtpsAssignment.feedback.push(feedback)
+ });
+ }
+ }
+ });
+
+ //Add assignment to results array
+ assignments.push(dtpsAssignment);
+ });
+
+ resolve(assignments);
+ }).catch(reject);
+ });
+}
+
+//Fetches modules data from Canvas
+dtpsLMS.fetchModules = function (userID, classID) {
+ return new Promise(function (resolve, reject) {
+ Promise.all([
+ fetch("/api/v1/courses/" + classID + "/modules?include[]=items&include[]=content_details", { headers: dtpsLMS.commonHeaders }),
+ fetch("/courses/" + classID + "/modules/progressions", { headers: dtpsLMS.commonHeaders })
+ ]).then(responses => {
+ return Promise.all(responses.map(r => r.json()));
+ }).then(data => {
+ var [modulesData, progressionData] = data;
+
+ //Get collapsed modules from progression data
+ var collapsedModules = {};
+
+ //Loop over progression data
+ progressionData.forEach(prog => {
+ //Store collapsed state
+ collapsedModules[prog.context_module_progression.context_module_id] = prog.context_module_progression.collapsed;
+ })
+
+ //Parse data from Canvas
+ var dtpsModules = modulesData.map(module => {
+ //Create module items array
+ var moduleItems = [];
+
+ //Add module items to array
+ module.items.forEach(item => {
+ if (item.type.toUpperCase() == "ASSIGNMENT") {
+ moduleItems.push({
+ type: "assignment",
+ title: item.title,
+ id: item.content_id,
+ indent: item.indent,
+ url: item.html_url,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ })
+ } else if (item.type.toUpperCase() == "PAGE") {
+ moduleItems.push({
+ type: "page",
+ title: item.title,
+ id: item.page_url,
+ indent: item.indent,
+ url: item.html_url,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ })
+ } else if (item.type.toUpperCase() == "DISCUSSION") {
+ moduleItems.push({
+ type: "discussion",
+ title: item.title,
+ id: item.content_id,
+ indent: item.indent,
+ url: item.html_url,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ })
+ } else if (item.type.toUpperCase() == "EXTERNALURL") {
+ moduleItems.push({
+ type: "url",
+ title: item.title,
+ url: item.external_url,
+ indent: item.indent,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ })
+ } else if (item.type.toUpperCase() == "EXTERNALTOOL") {
+ moduleItems.push({
+ type: "embed",
+ title: item.title,
+ url: item.html_url,
+ indent: item.indent,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ });
+ } else if (item.type.toUpperCase() == "SUBHEADER") {
+ moduleItems.push({
+ type: "header",
+ title: item.title,
+ indent: item.indent,
+ completed: item.completion_requirement && item.completion_requirement.completed
+ })
+ }
+ })
+
+ return {
+ id: module.id,
+ title: module.name,
+ collapsed: collapsedModules[module.id] || false,
+ items: moduleItems
+ }
+ })
+
+ //Resolve with module data
+ resolve(dtpsModules);
+ }).catch(reject);
+ });
+}
+
+//Collapses a module in Canvas
+dtpsLMS.collapseModule = function (classID, modID, collapsed) {
+ return fetch("/courses/" + classID + "/modules/" + modID + "/collapse", {
+ method: "POST",
+ headers: {
+ "Accept": "application/json, text/javascript, application/json+canvas-string-ids, */*; q=0.01",
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
+ "X-CSRF-Token": decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
+ },
+ body: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
+ });
+}
+
+//Collapses all modules in Canvas
+dtpsLMS.collapseAllModules = function (classID, collapsed) {
+ return fetch("/courses/" + classID + "/collapse_all_modules", {
+ method: "POST",
+ headers: {
+ "Accept": "application/json, text/javascript, application/json+canvas-string-ids, */*; q=0.01",
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
+ "X-CSRF-Token": decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
+ },
+ body: "_method=POST&collapse=" + (collapsed ? 1 : 0) + "&authenticity_token=" + decodeURIComponent(document.cookie).split("_csrf_token=")[1].split(";")[0]
+ });
+}
+
+//Fetches announcement data from Canvas
+dtpsLMS.fetchAnnouncements = function (classID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/announcements?context_codes[]=course_" + classID, { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ var dtpsAnnouncements = data.map(function (announcement) {
+ return {
+ title: announcement.title,
+ postedAt: announcement.created_at,
+ body: announcement.message,
+ url: announcement.html_url
+ }
+ });
+
+ resolve(dtpsAnnouncements);
+ }).catch(reject);
+ });
+}
+
+//Fetches user data from Canvas
+dtpsLMS.fetchUsers = function (classID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/sections?include[]=avatar_url&include[]=students&per_page=99", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ var teachers = dtpsLMS.teacherCache[classID];
+ var sections = [{
+ title: "Teachers",
+ id: "lms.dtps.canvas-teachers",
+ users: []
+ }];
+
+ teachers.forEach(teacher => {
+ sections[0].users.push({
+ name: teacher.display_name,
+ id: teacher.id,
+ photoURL: teacher.avatar_image_url,
+ url: "/courses/" + classID + "/users/" + teacher.id
+ });
+ });
+
+ data.forEach(section => {
+ if (!section.students) return;
+ var users = [];
+ section.students.forEach(student => {
+ users.push({
+ name: student.short_name,
+ id: student.id,
+ photoURL: student.avatar_url,
+ url: "/courses/" + classID + "/users/" + student.id
+ });
+ });
+ var dtechMatch = section.name.match(/[0-9](?=\(A)/);
+ if (dtpsLMS.dtech && dtechMatch) {
+ section.name = dtechMatch[0] == 7 ? "@d.tech" : "Period " + dtechMatch[0];
+ }
+ sections.push({
+ title: section.name,
+ id: section.id,
+ users
+ });
+ });
+ resolve(sections);
+ }).catch(reject);
+ });
+}
+
+//Fetches homepage data from Canvas
+dtpsLMS.fetchHomepage = function (classID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/front_page", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ resolve(data.body);
+ }).catch(reject);
+ });
+}
+
+//Fetches discussion thread data from Canvas
+dtpsLMS.fetchDiscussionThreads = function (classID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/discussion_topics", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ var dtpsDiscussionThreads = data.map(function (thread) {
+ return {
+ title: thread.title,
+ id: thread.id,
+ locked: thread.locked_for_user
+ }
+ });
+
+ resolve(dtpsDiscussionThreads);
+ }).catch(reject);
+ })
+}
+
+//Fetches discussion thread posts from Canvas
+dtpsLMS.fetchDiscussionPosts = function (classID, threadID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(threadData => {
+ //Check if this discussion is a group discussion
+ if (threadData.group_topic_children && threadData.group_topic_children.length) {
+ //This discussion is probably a group discussion, check groups, then fetch posts
+ fetch("/api/v1/courses/" + classID + "/groups?only_own_groups=true", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(groupData => {
+ //Get array of group IDs
+ var myGroups = groupData.map(group => group.id);
+
+ //Set default group and discussion ID variables
+ var groupID = null;
+ var groupDiscussionID = null;
+
+ //Check every group this discussion has and see if one of them is in myGroups, set that group as the group to fetch posts for
+ threadData.group_topic_children.forEach(group => {
+ if (myGroups.includes(group.group_id)) {
+ groupID = group.group_id;
+ groupDiscussionID = group.id;
+ }
+ });
+
+ if (!groupID || !groupDiscussionID) {
+ //Couldn't find a group match, fetch class discussion
+ fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
+ parseResponse(responsesData, "/courses/" + classID + "/discussion_topics/" + threadID);
+ });
+ } else {
+ //Group match found, fetch group discussion
+ fetch("/api/v1/groups/" + groupID + "/discussion_topics/" + groupDiscussionID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
+ parseResponse(responsesData, "/groups/" + groupID + "/discussion_topics/" + groupDiscussionID);
+ });
+ }
+ });
+ } else {
+ //Not a group discussion, directly fetch posts
+ fetch("/api/v1/courses/" + classID + "/discussion_topics/" + threadID + "/view", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(responsesData => {
+ parseResponse(responsesData, "/courses/" + classID + "/discussion_topics/" + threadID);
+ });
+ }
+
+
+ //This function handles the response from Canavs and returns the data to DTPS
+ //BaseURL is the baseURL of the thread, since this might be different for group discussions
+ function parseResponse(responsesData, baseURL) {
+ //Define discussions post array
+ var dtpsDiscussionPosts = [];
+
+ //Define the initial post
+ var initialPost = {
+ id: threadID,
+ body: threadData.message,
+ postedAt: threadData.created_at,
+ replyURL: baseURL
+ };
+
+ //Check for author
+ if (threadData.author && threadData.author.display_name) {
+ initialPost.author = {
+ name: threadData.author.display_name,
+ id: threadData.author.id,
+ photoURL: threadData.author.avatar_image_url
+ };
+ }
+
+ //Add initial post to array
+ dtpsDiscussionPosts.push(initialPost);
+
+ if (responsesData.view) {
+ //Get thread author information
+ var people = {};
+ if (responsesData.participants) {
+ responsesData.participants.forEach(participant => {
+ people[participant.id] = participant;
+ })
+ }
+
+ //If there are posts found from the second request, add those as well
+ responsesData.view.forEach(function (post) {
+ if (!post.deleted) {
+ var replies = [];
+
+ //Get replies for this post
+ if (post.replies) {
+ //If this post has replies, flatten them into a single array
+ function addReplies(arr, depth) {
+ //Loop over replies to add
+ arr.forEach(reply => {
+ //Add this reply to the array
+ if (!reply.deleted) {
+ //Define reply object
+ var dtpsReply = {
+ id: reply.id,
+ body: reply.message,
+ postedAt: reply.created_at,
+ replyURL: baseURL + "/entry-" + reply.id,
+ depth: depth
+ };
+
+ //Check for reply author
+ if (people[reply.user_id]) {
+ dtpsReply.author = {
+ name: people[reply.user_id].display_name,
+ id: reply.user_id,
+ photoURL: people[reply.user_id].avatar_image_url
+ }
+ }
+
+ //Add reply to flattened array
+ replies.push(dtpsReply);
+ }
+
+ //Add nested replies to array
+ if (reply.replies) addReplies(reply.replies, depth + 1);
+ });
+ }
+
+ addReplies(post.replies, 0);
+ }
+
+ //Define post object
+ var dtpsPost = {
+ id: post.id,
+ body: post.message,
+ postedAt: post.created_at,
+ replies: replies,
+ replyURL: baseURL + "/entry-" + post.id
+ };
+
+ //Check for post author
+ if (people[post.user_id]) {
+ dtpsPost.author = {
+ name: people[post.user_id].display_name,
+ id: post.user_id,
+ photoURL: people[post.user_id].avatar_image_url
+ }
+ }
+
+ //Add post to array
+ dtpsDiscussionPosts.push(dtpsPost);
+ }
+ });
+ }
+
+ resolve({
+ title: threadData.title,
+ id: threadData.id,
+ locked: threadData.locked_for_user,
+ posts: dtpsDiscussionPosts
+ });
+ }
+ }).catch(reject);
+ });
+}
+
+//Fetches pages list data from Canvas
+dtpsLMS.fetchPages = function (classID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/pages?per_page=100", { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ var dtpsPages = data.map(function (page) {
+ var dtpsPage = {
+ title: page.title,
+ id: page.url
+ };
+
+ return dtpsPage;
+ });
+
+ resolve(dtpsPages);
+ }).catch(reject);
+ })
+}
+
+//Fetches pages list data from Canvas
+dtpsLMS.fetchPageContent = function (classID, pageID) {
+ return new Promise(function (resolve, reject) {
+ fetch("/api/v1/courses/" + classID + "/pages/" + pageID, { headers: dtpsLMS.commonHeaders }).then(response => response.json()).then(data => {
+ //Resolve with full page object
+ var dtpsPage = {
+ title: data.title,
+ id: data.url,
+ updatedAt: data.updated_at,
+ content: data.body
+ };
+
+ //Check for page author
+ if (data.last_edited_by) {
+ dtpsPage.author = {
+ name: data.last_edited_by.display_name,
+ id: data.last_edited_by.id,
+ photoURL: data.last_edited_by.avatar_image_url
+ }
+ }
+
+ resolve(dtpsPage);
+ }).catch(reject);
+ })
+}
+
+//Get baseURL from the URL of this script
+var baseURL = document.currentScript.src.split("/scripts/lms/canvas.js")[0];
+
+//Load Power+
jQuery.getScript(baseURL + "/scripts/core.js");
\ No newline at end of file
diff --git a/scripts/lms/demo.js b/scripts/lms/demo.js
index 932cd94..95a1126 100644
--- a/scripts/lms/demo.js
+++ b/scripts/lms/demo.js
@@ -1,316 +1,316 @@
-/**
- * @file DTPS Demo LMS
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- *
- * This LMS script is for demonstrating Power+ and doesn't fetch actual data
- * JSDoc documentation for these LMS functions can be found near the end of core.js
- */
-
-//DTPS LMS configuration
-var dtpsLMS = {
- name: "Demo LMS",
- shortName: "Demo",
- description: "All content in this LMS is not real and is for demonstration purposes only",
- url: "https://powerplus.app",
- logo: "https://powerplus.app/logo.png",
- source: "https://github.com/jottocraft/dtps/blob/main/scripts/lms/demo.js",
- genericGradebook: true,
- isDemoLMS: true
-};
-
-//Return sample user data
-dtpsLMS.fetchUser = function () {
- return new Promise(function (resolve, reject) {
- resolve({
- name: "Demo User",
- id: "1",
- photoURL: "https://powerplus.app/logo.png"
- });
- })
-}
-
-//Fetch class data from Canvas
-dtpsLMS.fetchClasses = function (userID) {
- return new Promise(function (resolve, reject) {
- resolve([{
- name: "Demo Class",
- id: "1",
- subject: "Demo Class",
- description: `<p>This class is for demonstration purposes only and is not a real class</p>`,
- homepage: true,
- numStudents: 1337,
- modules: true,
- discussions: true,
- pages: true,
- color: "#8800ff",
- grade: 81,
- letter: "B-",
- previousLetter: "A",
- image: "https://powerplus.app/wallpaper.png",
- teacher: {
- name: "Demo Teacher",
- id: "2",
- photoURL: "https://powerplus.app/logo.png"
- }
- }]);
- })
-}
-
-//Fetches assignment data from Canvas
-dtpsLMS.fetchAssignments = function (userID, classID) {
- return new Promise(function (resolve, reject) {
- if (classID == "1") {
- resolve([
- {
- title: "Demo assignment 1",
- id: "191",
- body: "<p>This assignment is for demonstration purposes only</p>",
- dueAt: new Date().getTime() + 3000000,
- turnedIn: true,
- locked: false,
- category: "Demo assignments",
- value: 12,
- publishedAt: new Date().getTime() - 100000000,
- rubric: [
- {
- title: "Demo outcome 1",
- id: "1",
- value: 4,
- description: "This outcome is for demonstration purposes only"
- },
- {
- title: "Demo outcome 2",
- id: "2",
- value: 4,
- description: "This outcome is for demonstration purposes only"
- },
- {
- title: "Demo outcome 3",
- id: "3",
- value: 4,
- description: "This outcome is for demonstration purposes only"
- }
- ]
- },
- {
- title: "Demo assignment 2",
- id: "192",
- body: "<p>This assignment is for demonstration purposes only</p>",
- dueAt: new Date().getTime() - 100000000,
- turnedIn: true,
- locked: true,
- gradedAt: new Date(),
- grade: 8,
- value: 8,
- letter: "A",
- category: "Demo assignments",
- publishedAt: new Date().getTime() - 1000000000,
- rubric: [
- {
- title: "Demo outcome 1",
- id: "1",
- value: 4,
- description: "This outcome is for demonstration purposes only",
- score: 4,
- scoreName: "Beyond Innovation++",
- color: "#4f9e59"
- },
- {
- title: "Demo outcome 2",
- id: "2",
- value: 4,
- description: "This outcome is for demonstration purposes only",
- score: 4,
- scoreName: "Beyond Innovation++",
- color: "#4f9e59"
- }
- ]
- },
- {
- title: "Demo assignment 3",
- id: "193",
- body: "<p>This assignment is for demonstration purposes only</p>",
- dueAt: new Date().getTime() - 100000000,
- turnedIn: true,
- late: true,
- locked: true,
- grade: 5,
- gradedAt: new Date(),
- value: 8,
- letter: "B",
- category: "Demo assignments",
- publishedAt: new Date().getTime() - 1000000000,
- rubric: [
- {
- title: "Demo outcome 1",
- id: "1",
- value: 4,
- description: "This outcome is for demonstration purposes only",
- score: 2,
- scoreName: "Developing",
- color: "#c26d44"
- },
- {
- title: "Demo outcome 2",
- id: "2",
- value: 4,
- description: "This outcome is for demonstration purposes only",
- score: 3,
- scoreName: "Proficient",
- color: "#a1b553"
- }
- ]
- },
- {
- title: "Demo assignment 4",
- id: "194",
- body: "<p>This assignment is for demonstration purposes only</p>",
- dueAt: new Date().getTime() + 10000000,
- value: 4,
- category: "Demo assignments",
- publishedAt: new Date().getTime() - 1000000000,
- rubric: [
- {
- title: "Demo outcome 1",
- id: "1",
- value: 4,
- description: "This outcome is for demonstration purposes only"
- }
- ]
- }
- ])
- }
- })
-}
-
-//Fetches modules data from Canvas
-dtpsLMS.fetchModules = function (userID, classID) {
- return new Promise(function (resolve, reject) {
- resolve([
- {
- title: "Demo module",
- id: "1",
- items: [
- {
- type: "url",
- title: "google.com",
- url: "https://www.google.com"
- },
- {
- type: "page",
- title: "Demo Page",
- id: "1"
- },
- {
- type: "discussion",
- title: "Demo Discussion",
- id: "1"
- },
- {
- type: "assignment",
- title: "Demo Assignment 1",
- id: "191"
- },
- {
- type: "assignment",
- title: "Demo Assignment 2",
- id: "192"
- }
- ]
- }
- ]);
- });
-}
-
-//Fetches announcement data from Canvas
-dtpsLMS.fetchAnnouncements = function (classID) {
- return new Promise(function (resolve, reject) {
- resolve([{
- title: "Demo Announcement",
- postedAt: new Date().getDate(),
- body: "<p>This announcement is for demonstration purposes only</p>"
- }]);
- });
-}
-
-//Fetches homepage data from Canvas
-dtpsLMS.fetchHomepage = function (classID) {
- return new Promise(function (resolve, reject) {
- resolve(`<p>This homepage is for demonstration purposes only</p>`);
- });
-}
-
-//Fetches discussion thread data from Canvas
-dtpsLMS.fetchDiscussionThreads = function (classID) {
- return new Promise(function (resolve, reject) {
- resolve([
- {
- title: "Demo Discussion",
- id: "1",
- locked: true
- }
- ])
- })
-}
-
-//Fetches discussion thread posts from Canvas
-dtpsLMS.fetchDiscussionPosts = function (classID, threadID) {
- return new Promise(function (resolve, reject) {
- resolve({
- title: "Demo Discussion",
- id: "1",
- locked: true,
- requireInitialPost: false,
- posts: [
- {
- id: "1",
- body: `<p>This discussion is for demonstration purposes only</p>`,
- postedAt: new Date(),
- author: {
- name: "Demo Teacher",
- id: "2",
- photoURL: "https://powerplus.app/logo.png"
- }
- }
- ]
- })
- })
-}
-
-//Fetches pages list data from Canvas
-dtpsLMS.fetchPages = function (classID) {
- return new Promise(function (resolve, reject) {
- resolve([
- {
- title: "Demo Page",
- id: "1"
- }
- ])
- })
-}
-
-//Fetches pages list data from Canvas
-dtpsLMS.fetchPageContent = function (classID, pageID) {
- return new Promise(function (resolve, reject) {
- resolve({
- title: "Demo Page",
- id: "1",
- updatedAt: new Date(),
- content: `<p>This page is for demonstration purposes only</p>`,
- author: {
- name: "Demo Teacher",
- id: "2",
- photoURL: "https://powerplus.app/logo.png"
- }
- });
- })
-}
-
-//Get baseURL from the URL of this script
-var baseURL = document.currentScript.src.split("/scripts/lms/demo.js")[0];
-
-//Load Power+
+/**
+ * @file DTPS Demo LMS
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ *
+ * This LMS script is for demonstrating Power+ and doesn't fetch actual data
+ * JSDoc documentation for these LMS functions can be found near the end of core.js
+ */
+
+//DTPS LMS configuration
+var dtpsLMS = {
+ name: "Demo LMS",
+ shortName: "Demo",
+ description: "All content in this LMS is not real and is for demonstration purposes only",
+ url: "https://powerplus.app",
+ logo: "https://powerplus.app/logo.png",
+ source: "https://github.com/jottocraft/dtps/blob/main/scripts/lms/demo.js",
+ genericGradebook: true,
+ isDemoLMS: true
+};
+
+//Return sample user data
+dtpsLMS.fetchUser = function () {
+ return new Promise(function (resolve, reject) {
+ resolve({
+ name: "Demo User",
+ id: "1",
+ photoURL: "https://powerplus.app/logo.png"
+ });
+ })
+}
+
+//Fetch class data from Canvas
+dtpsLMS.fetchClasses = function (userID) {
+ return new Promise(function (resolve, reject) {
+ resolve([{
+ name: "Demo Class",
+ id: "1",
+ subject: "Demo Class",
+ description: `<p>This class is for demonstration purposes only and is not a real class</p>`,
+ homepage: true,
+ numStudents: 1337,
+ modules: true,
+ discussions: true,
+ pages: true,
+ color: "#8800ff",
+ grade: 81,
+ letter: "B-",
+ previousLetter: "A",
+ image: "https://powerplus.app/wallpaper.png",
+ teacher: {
+ name: "Demo Teacher",
+ id: "2",
+ photoURL: "https://powerplus.app/logo.png"
+ }
+ }]);
+ })
+}
+
+//Fetches assignment data from Canvas
+dtpsLMS.fetchAssignments = function (userID, classID) {
+ return new Promise(function (resolve, reject) {
+ if (classID == "1") {
+ resolve([
+ {
+ title: "Demo assignment 1",
+ id: "191",
+ body: "<p>This assignment is for demonstration purposes only</p>",
+ dueAt: new Date().getTime() + 3000000,
+ turnedIn: true,
+ locked: false,
+ category: "Demo assignments",
+ value: 12,
+ publishedAt: new Date().getTime() - 100000000,
+ rubric: [
+ {
+ title: "Demo outcome 1",
+ id: "1",
+ value: 4,
+ description: "This outcome is for demonstration purposes only"
+ },
+ {
+ title: "Demo outcome 2",
+ id: "2",
+ value: 4,
+ description: "This outcome is for demonstration purposes only"
+ },
+ {
+ title: "Demo outcome 3",
+ id: "3",
+ value: 4,
+ description: "This outcome is for demonstration purposes only"
+ }
+ ]
+ },
+ {
+ title: "Demo assignment 2",
+ id: "192",
+ body: "<p>This assignment is for demonstration purposes only</p>",
+ dueAt: new Date().getTime() - 100000000,
+ turnedIn: true,
+ locked: true,
+ gradedAt: new Date(),
+ grade: 8,
+ value: 8,
+ letter: "A",
+ category: "Demo assignments",
+ publishedAt: new Date().getTime() - 1000000000,
+ rubric: [
+ {
+ title: "Demo outcome 1",
+ id: "1",
+ value: 4,
+ description: "This outcome is for demonstration purposes only",
+ score: 4,
+ scoreName: "Beyond Innovation++",
+ color: "#4f9e59"
+ },
+ {
+ title: "Demo outcome 2",
+ id: "2",
+ value: 4,
+ description: "This outcome is for demonstration purposes only",
+ score: 4,
+ scoreName: "Beyond Innovation++",
+ color: "#4f9e59"
+ }
+ ]
+ },
+ {
+ title: "Demo assignment 3",
+ id: "193",
+ body: "<p>This assignment is for demonstration purposes only</p>",
+ dueAt: new Date().getTime() - 100000000,
+ turnedIn: true,
+ late: true,
+ locked: true,
+ grade: 5,
+ gradedAt: new Date(),
+ value: 8,
+ letter: "B",
+ category: "Demo assignments",
+ publishedAt: new Date().getTime() - 1000000000,
+ rubric: [
+ {
+ title: "Demo outcome 1",
+ id: "1",
+ value: 4,
+ description: "This outcome is for demonstration purposes only",
+ score: 2,
+ scoreName: "Developing",
+ color: "#c26d44"
+ },
+ {
+ title: "Demo outcome 2",
+ id: "2",
+ value: 4,
+ description: "This outcome is for demonstration purposes only",
+ score: 3,
+ scoreName: "Proficient",
+ color: "#a1b553"
+ }
+ ]
+ },
+ {
+ title: "Demo assignment 4",
+ id: "194",
+ body: "<p>This assignment is for demonstration purposes only</p>",
+ dueAt: new Date().getTime() + 10000000,
+ value: 4,
+ category: "Demo assignments",
+ publishedAt: new Date().getTime() - 1000000000,
+ rubric: [
+ {
+ title: "Demo outcome 1",
+ id: "1",
+ value: 4,
+ description: "This outcome is for demonstration purposes only"
+ }
+ ]
+ }
+ ])
+ }
+ })
+}
+
+//Fetches modules data from Canvas
+dtpsLMS.fetchModules = function (userID, classID) {
+ return new Promise(function (resolve, reject) {
+ resolve([
+ {
+ title: "Demo module",
+ id: "1",
+ items: [
+ {
+ type: "url",
+ title: "google.com",
+ url: "https://www.google.com"
+ },
+ {
+ type: "page",
+ title: "Demo Page",
+ id: "1"
+ },
+ {
+ type: "discussion",
+ title: "Demo Discussion",
+ id: "1"
+ },
+ {
+ type: "assignment",
+ title: "Demo Assignment 1",
+ id: "191"
+ },
+ {
+ type: "assignment",
+ title: "Demo Assignment 2",
+ id: "192"
+ }
+ ]
+ }
+ ]);
+ });
+}
+
+//Fetches announcement data from Canvas
+dtpsLMS.fetchAnnouncements = function (classID) {
+ return new Promise(function (resolve, reject) {
+ resolve([{
+ title: "Demo Announcement",
+ postedAt: new Date().getDate(),
+ body: "<p>This announcement is for demonstration purposes only</p>"
+ }]);
+ });
+}
+
+//Fetches homepage data from Canvas
+dtpsLMS.fetchHomepage = function (classID) {
+ return new Promise(function (resolve, reject) {
+ resolve(`<p>This homepage is for demonstration purposes only</p>`);
+ });
+}
+
+//Fetches discussion thread data from Canvas
+dtpsLMS.fetchDiscussionThreads = function (classID) {
+ return new Promise(function (resolve, reject) {
+ resolve([
+ {
+ title: "Demo Discussion",
+ id: "1",
+ locked: true
+ }
+ ])
+ })
+}
+
+//Fetches discussion thread posts from Canvas
+dtpsLMS.fetchDiscussionPosts = function (classID, threadID) {
+ return new Promise(function (resolve, reject) {
+ resolve({
+ title: "Demo Discussion",
+ id: "1",
+ locked: true,
+ requireInitialPost: false,
+ posts: [
+ {
+ id: "1",
+ body: `<p>This discussion is for demonstration purposes only</p>`,
+ postedAt: new Date(),
+ author: {
+ name: "Demo Teacher",
+ id: "2",
+ photoURL: "https://powerplus.app/logo.png"
+ }
+ }
+ ]
+ })
+ })
+}
+
+//Fetches pages list data from Canvas
+dtpsLMS.fetchPages = function (classID) {
+ return new Promise(function (resolve, reject) {
+ resolve([
+ {
+ title: "Demo Page",
+ id: "1"
+ }
+ ])
+ })
+}
+
+//Fetches pages list data from Canvas
+dtpsLMS.fetchPageContent = function (classID, pageID) {
+ return new Promise(function (resolve, reject) {
+ resolve({
+ title: "Demo Page",
+ id: "1",
+ updatedAt: new Date(),
+ content: `<p>This page is for demonstration purposes only</p>`,
+ author: {
+ name: "Demo Teacher",
+ id: "2",
+ photoURL: "https://powerplus.app/logo.png"
+ }
+ });
+ })
+}
+
+//Get baseURL from the URL of this script
+var baseURL = document.currentScript.src.split("/scripts/lms/demo.js")[0];
+
+//Load Power+
jQuery.getScript(baseURL + "/scripts/core.js");
\ No newline at end of file
diff --git a/scripts/lms/dtech.js b/scripts/lms/dtech.js
index 3c9f33b..cbb2a94 100644
--- a/scripts/lms/dtech.js
+++ b/scripts/lms/dtech.js
@@ -1,861 +1,861 @@
-/**
- * @file d.tech-specific features, CBL & grade calculation
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- *
- * JSDoc documentation for these LMS functions can be found near the end of core.js
- */
-
-//Get baseURL from the URL of this script
-var baseURL = document.currentScript.src.split("/scripts/lms/dtech.js")[0];
-
-//Load Canvas integration
-jQuery.getScript(baseURL + "/scripts/lms/canvas.js", function () {
- //Add d.tech-specific items to dtpsLMS
- dtpsLMS.name = "d.tech";
- dtpsLMS.legalName = "Canvas LMS, Design Tech High School, or Instructure Inc";
- dtpsLMS.description = "Power+ integration for Canvas LMS, customized for d.tech";
- dtpsLMS.logo = "https://i.imgur.com/efGrLq3.png";
- dtpsLMS.source = "https://github.com/jottocraft/dtps/blob/main/scripts/lms/dtech.js";
- dtpsLMS.useRubricGrades = true;
- dtpsLMS.institutionSpecific = true;
- dtpsLMS.genericGradebook = false;
- dtpsLMS.dtech = true;
-
- //Check if due date is usual
- dtpsLMS.isUsualDueDate = function (date) {
- var date = new Date(date);
-
- if (date.getHours() >= 22) {
- return true;
- } else if ((date.getHours() == 21) && (date.getMinutes() > 50)) {
- return true;
- } else if (date.getHours() < 8) {
- return true;
- }
-
- return false;
- };
-
- //Update assignments
- //This is for customizing rubric names and colors to match d.tech CBL
- dtpsLMS.updateAssignments = function (rawAssignments) {
- return new Promise((resolve, reject) => {
- var updatedAssignments = rawAssignments.map(assignment => {
- //Check if assignment has rubric
- if (assignment.rubric) {
- //Update assignment rubric
- assignment.rubric.forEach(rubricItem => {
- rubricItem.scoreName = shortenDtechRubricScoreName(rubricItem.scoreName);
-
- if (rubricItem.score !== undefined) {
- rubricItem.color = dtechRubricColor(rubricItem.score);
- }
- });
- }
-
- //Return updated assignment to the Array.map function
- return assignment;
- });
-
- resolve(updatedAssignments);
- })
- }
-
- //Update classes
- dtpsLMS.updateClasses = function (classes) {
- return new Promise((resolve, reject) => {
- var tmpNewArray = [];
- classes.forEach((course, i) => {
- if (course.term == dtps.remoteConfig.dtechCurrentTerm) {
- tmpNewArray.push(course);
- } else if (course.id == dtps.remoteConfig.debugClassID) {
- tmpNewArray.push(course);
- } else if (!course.endDate || (new Date() < new Date(course.endDate))) {
- tmpNewArray.push(course);
- }
-
- //Check if course is ineligible for videoMeetingURL
- if (!dtps.remoteConfig.showVideoMeetingButton || dtps.user.parent || !course.homepage || (course.term !== dtps.remoteConfig.dtechCurrentTerm)) {
- course.videoMeetingURL = null;
- }
-
- //Get course period
- var matches = course.period.match(/[0-9](?=\(A)/);
- if (matches && matches[0]) {
- course.period = matches[0] == "7" ? 0 : Number(matches[0]);
- } else if (/(d|design)(\.| |-)?lab/gi.test(course.subject)) {
- course.period = 11;
- } else if (/exploration/gi.test(course.subject)) {
- course.period = 12;
- } else {
- course.period = Infinity;
- }
-
- //Get course cycle
- if (!dtps.user.parent && (window.localStorage.getItem("pref-autoGroupClasses") !== "false")) {
- if ((course.period >= 1) && (course.period <= 3)) {
- course.group = "Cycle 1/3";
- } else if ((course.period >= 4) && (course.period <= 6)) {
- course.group = "Cycle 2/4";
- } else if ((course.period == 11) || (course.period == 12)) {
- course.group = "Intersession";
- }
- }
-
- //Add course icon
- if (course.id == dtps.remoteConfig.debugClassID) {
- course.icon = "bug_report";
- } else if (/Game/gi.test(course.subject)) {
- course.icon = "games";
- } else if (/Architecture/gi.test(course.subject)) {
- course.icon = "architecture";
- } else if (/History/gi.test(course.subject)) {
- course.icon = "history_edu";
- } else if (/Biology/gi.test(course.subject)) {
- course.icon = "biotech";
- } else if (/Physics|Science|Chemistry/gi.test(course.subject)) {
- course.icon = "science";
- } else if (/Math|Algebra|Geometry|Calculus|Statistics/gi.test(course.subject)) {
- course.icon = "calculate";
- } else if (/Engineering|DRG/gi.test(course.subject)) {
- course.icon = "engineering";
- } else if (/((d|design)(\.| |-)?lab)|Prototyping/gi.test(course.subject)) {
- course.icon = "design_services";
- } else if (/Exploration/gi.test(course.subject)) {
- course.icon = "explore";
- } else if (/@d.?tech/gi.test(course.subject)) {
- course.icon = "school";
- } else if (/English/gi.test(course.subject)) {
- course.icon = "description";
- } else if (/Model( |-|)(United Nations|UN)/gi.test(course.subject)) {
- course.icon = "public";
- } else if (/Spanish|Language/gi.test(course.subject)) {
- course.icon = "translate";
- } else if (/Government/gi.test(course.subject)) {
- course.icon = "gavel";
- } else if (/(Koi|Live)( |-|)Stream/gi.test(course.subject)) {
- course.icon = "live_tv";
- } else if (/Film/gi.test(course.subject)) {
- course.icon = "camera_roll";
- } else if (/Leadership/gi.test(course.subject)) {
- course.icon = "stars";
- } else if (/Athletics/gi.test(course.subject)) {
- course.icon = "sports_handball";
- }
- });
- classes = tmpNewArray;
-
- //Automatically sort and group classes if enabled
- if (!dtps.user.parent && (window.localStorage.getItem("pref-autoGroupClasses") !== "false")) {
- classes.sort((a, b) => {
- return a.period - b.period;
- });
- }
-
- resolve(classes);
- });
- }
-
- //Fetch videoMeetingURL for a class
- dtpsLMS.fetchMeetingURL = function (classID) {
- return new Promise((resolve, reject) => {
- var course = dtps.classes.find(course => course.id == classID);
-
- if (course.homepage && (course.term == dtps.remoteConfig.dtechCurrentTerm)) {
- dtpsLMS.fetchHomepage(classID).then(homepage => {
- //get zoom link
- var meetingURL = null;
- var matches = 0;
- for (var i = 0; i < $(homepage).find("a").length; i++) {
- var link = $($(homepage).find("a")[i]);
- if (link.children("img").attr("alt") && link.children("img").attr("alt").toUpperCase().includes("ZOOM BUTTON") && link.attr("href")) {
- //Button labelled as zoom button
- meetingURL = link.attr("href");
- } else if (link.attr("href") && link.attr("href").includes("zoom.us")) {
- //Button link goes to a zoom meeting, only use this if there is no other zoom link
- //if (!meetingURL) meetingURL = link.attr("href");
- }
- }
-
- if (matches > 1) {
- //Multiple zoom links found
- meetingURL = null;
- }
-
- resolve(meetingURL);
- });
- }
- })
- }
-
- //Run d.tech grade calculation algorithm (defined below)
- dtpsLMS.calculateGrade = function (course, assignments) {
- var formula = null;
-
- //Get d.tech grade calculation formula
- if (course.term == "20-21") {
- formula = "2020s1";
- } else if (String(course.id).includes(dtps.remoteConfig.debugClassID)) {
- formula = "2020s1";
- }
-
- //If there is no grade calculation formula, don't run grade calc
- if (!formula) return;
-
- //Run d.tech grade calculation
- var dtechResults = dtechGradeCalc.run(assignments, formula);
-
- if (dtechResults) {
- //Class has a grade
- return {
- letter: dtechResults.results.letter,
- dtech: dtechResults //Return dtech results for gradebook
- };
- } else {
- //No grade for this class
- return;
- }
- }
-
- //Local functions & variables, not part of the dtpsLMS specification ----------------------------------------------
-
- //Shortens rubric name for d.tech CBL rubrics
- var shortenDtechRubricScoreName = function (rating) {
- if (String(rating).toUpperCase().includes("PIONEERING")) return "Pioneering";
- if (String(rating).toUpperCase().includes("PROFICIENT")) return "Proficient";
- if (String(rating).toUpperCase().includes("DEVELOPING")) return "Developing";
- if (String(rating).toUpperCase().includes("EMERGING")) return "Emerging";
- if (!String(rating).includes(" ") && (String(rating).length <= 20)) return rating;
- return "";
- }
-
- //Get score color from rubric percentage
- var dtechRubricColor = function (score) {
- if (score > 4.0) return "#20D684";
- if (score == 4.0) return "#41BA35";
- if (score >= 3.9) return "#50BC39";
- if (score >= 3.8) return "#5FBD3D";
- if (score >= 3.7) return "#6EBF40";
- if (score >= 3.6) return "#7DC044";
- if (score >= 3.5) return "#8CC248";
- if (score >= 3.4) return "#9AC44C";
- if (score >= 3.3) return "#A9C550";
- if (score >= 3.2) return "#B8C753";
- if (score >= 3.1) return "#C7C857";
- if (score >= 3.0) return "#D6CA5B";
- if (score >= 2.9) return "#D8C35A";
- if (score >= 2.8) return "#DABB59";
- if (score >= 2.7) return "#DCB458";
- if (score >= 2.6) return "#DEAC57";
- if (score >= 2.5) return "#E1A556";
- if (score >= 2.4) return "#E39E55";
- if (score >= 2.3) return "#E59654";
- if (score >= 2.2) return "#E78F53";
- if (score >= 2.1) return "#E98752";
- if (score >= 2.0) return "#EB8051";
- if (score >= 1.9) return "#E97A50";
- if (score >= 1.8) return "#E7744F";
- if (score >= 1.7) return "#E56F4E";
- if (score >= 1.6) return "#E3694D";
- if (score >= 1.5) return "#E1634C";
- if (score >= 1.4) return "#DE5D4A";
- if (score >= 1.3) return "#DC5749";
- if (score >= 1.2) return "#DA5248";
- if (score >= 1.1) return "#D84C47";
- if (score >= 1.0) return "#D64646";
- if (score >= 0.0) return "#D72727";
- if (score < 0.0) return "#BF0000";
- }
-
- /**
- * d.tech CBL grade calculation algorithm
- *
- * @property {string[]} letters An array of letters that can be returned from highest -> lowest
- * @property {object} params Parameters for each type of grade calculation, such as requirements for each criteria
- */
- var dtechGradeCalc = {
- letters: ["A", "A-", "B+", "B", "B-", "C", "I"],
- params: {
- /**
- * @description 2020s1 grade calculation parameters
- * @property {{string, number}} percentage Percentage criteria parameters. The key of each item in the object is the letter and the value is the percentage needed to meet the criteria
- * @property {{string, number}} lowest Lowest average criteria perameters. The key of each item in the object is the letter and the value is the lowest average needed to meet the criteria
- */
- "2020s1": {
- percentage: {
- "A": 3.3,
- "A-": 3.3,
- "B+": 2.6,
- "B": 2.6,
- "B-": 2.6,
- "C": 2.2,
- "I": 0
- },
- lowest: {
- "A": 3,
- "A-": 2.5,
- "B+": 2.2,
- "B": 1.8,
- "B-": 1.5,
- "C": 1.5,
- "I": 0
- }
- }
- },
- /**
- * A simple average function
- *
- * @param {number[]} array Array of numbers to average
- * @return {number} Average of the numbers in the array
- */
- average: function (array) {
- var sum = 0;
- array.forEach(item => sum += item);
- return sum / array.length;
- },
- /**
- * Runs grade calculation. Takes assignments, gets outcome averages, then calls getLetter to get the final letter.
- * This function returns undefined if there is no grade.
- *
- * @param {Assignment[]} assignments Array of assignments to use for grade calculation
- * @param {string} formula Formula to use for grade calculation. Can be one of the following: 2020s1
- * @param {object} outcomesOverride An outcome object to use instead of using assignments. Used for what-if grades.
- * @return {object} Grade calculation results
- */
- run: function (assignments, formula, outcomesOverride) {
-
- //Array of grade variations
- var gradeVariations = [];
-
- //Outcomes object
- //This doesn't have to be used by the grade calculation formula. Can be overridden for What-If grades.
- var outcomes = outcomesOverride || {};
-
- if (formula == "2020s1") {
- //2020-21 SEMESTER 1 OUTCOME AVERAGE FORMULA (2020s1)
-
- // ------- [2020s1] Step 1: Get rubric assessments by outcome -------
-
- if (!outcomesOverride) {
- assignments.forEach(assignment => {
- if (assignment.rubric) {
- //Assignment has a rubric
-
- assignment.rubric.forEach(rubricItem => {
- if ((rubricItem.score !== undefined) && rubricItem.outcome) {
- //Rubric item is assessed and is linked with an outcome
-
- if (!outcomes[rubricItem.outcome]) {
- //Outcome object doesn't exist yet
- outcomes[rubricItem.outcome] = {
- scores: []
- };
- }
-
- //Add RubricItem to outcome array
- outcomes[rubricItem.outcome].scores.push(rubricItem);
-
- //Save outcome name as rubric title
- if (rubricItem.title) outcomes[rubricItem.outcome].title = rubricItem.title;
- }
- });
- }
- });
- }
-
- // ------- [2020s1] Step 2: Calculate outcome averages -------
-
- //If there are no outcomes, this class doesn't have a grade
- if (Object.keys(outcomes).length == 0) return;
-
- //Loop over the values of each item in the outcomes object
- Object.values(outcomes).forEach(outcome => {
- //Get array of scores for the outcome, remove null scores
- var outcomeScores = outcome.scores.map(RubricItem => RubricItem.score).filter(score => score !== null);
-
- //Calculate outcome average with all outcome scores
- var average = this.average(outcomeScores);
-
- //Get the lowest score
- var lowestScore = Math.min(...outcomeScores);
-
- //Drop the lowest score to see what happens
- var droppedArray = outcomeScores.slice(); //copy of outcomeScores array
- droppedArray.splice(droppedArray.indexOf(lowestScore), 1); //remove lowest score from array
-
- var droppedAverage = this.average(droppedArray); //calculate average from droppedArray
-
- //Choose the higher score
- if (droppedAverage > average) {
- //The dropped score was higher
- outcome.scoreType = "dropped";
- outcome.droppedScore = outcome.scores.map(RubricItem => RubricItem.score).indexOf(lowestScore);
- outcome.average = droppedAverage;
- } else {
- //Calculating with all outcome scores was the same or higher
- outcome.scoreType = "all";
- outcome.average = average;
- delete outcome.droppedScore;
- }
- });
-
-
- // ------- [2020s1] Step 3: Calculate letter grade variations -------
-
- //All outcomes variation
- var outcomeAvgs = Object.values(outcomes).map(outcome => outcome.average);
- gradeVariations.push(this.getLetter(outcomeAvgs, formula, "all"));
-
- }
-
- //Get the highest grade variation from the results
- var bestVariation = null;
- gradeVariations.forEach(variation => {
- if (!bestVariation || (this.letters.indexOf(variation.letter) < this.letters.indexOf(bestVariation.letter))) {
- //variation.letter is a higher letter than bestVariation.letter, or there is no best variation yet
- bestVariation = variation;
- }
- });
-
- //Return grade calculation results
- return {
- results: bestVariation, //Results for the best variation
- formula: formula, //Formula used to calculate this grade
- outcomes: outcomes //Calculated outcome scores
- };
- },
- /**
- * Calculates a letter grade from an array of outcome averages. Called by gradeCalc.run.
- * Gets the best possible letter from each criteria, then the lowest letter from that array.
- *
- * @param {number[]} outcomeAvgs Array of outcome averages to use for letter grade calculation
- * @param {string} formula Formula to use for grade calculation. See gradeCalc.run.
- * @param {string} [variation] Name of the letter grade variation (e.g. withSS, withoutSS, etc.). Only used for formulas with multiple variations.
- * @return {object} Letter grade calculation results
- */
- getLetter: function (outcomeAvgs, formula, variation) {
- //Grade calculation results object
- //This includes any properties that need to be passed to the gradebook. The properties set depend on the formula.
- var parameters = {};
-
- //Sort outcome averages highest -> lowest
- outcomeAvgs.sort((a, b) => b - a);
-
- if (formula == "2020s1") {
- //2020-21 SEMESTER 1 LETTER GRADE FORMULA (2020s1)
-
- //Array of letters from each criteria
- var letters = [];
-
- // ------- [2020s1] Step 1: Get highest letter for Criteria 1 (percentage of outcomes criteria) -------
- var percentage = .75;
- var numOutcomesRequired = Math.floor(outcomeAvgs.length * percentage); //Minimum number of outcomes required
-
- //Calculate the value 75% of outcomes >= to (number75) and the number of outcomes needed to meet criteria 1
- if (outcomeAvgs.length == 1) {
- parameters.number75 = outcomeAvgs[0]; //if there is only 1 outcome, that outcome is number75
- } else {
- parameters.number75 = outcomeAvgs[numOutcomesRequired - 1]; //number75 = the outcome 75% through the array (since its sorted)
- }
- parameters.number75thresh = numOutcomesRequired; //number75thresh = number of outcomes needed to meet the criteria
-
- //Get the best letter
- var bestLetter = null;
-
- //Test each letter and add the highest to the letters array
- for (var i = 0; i < this.letters.length; i++) {
- let letter = this.letters[i];
-
- if (parameters.number75 >= this.params[formula].percentage[letter]) {
- //Able to get this letter
- bestLetter = letter;
-
- //Stop checking for matches since all letters after this are lower
- break;
- }
- }
-
- //Add highest criteria 1 letter to the letters array
- letters.push(bestLetter);
-
- // ------- [2020s1] Step 2: Get highest letter for Criteria 2 (lowest outcome criteria) -------
-
- //Reset best letter
- var bestLetter = null;
-
- //Since the array is highest -> lowest, the lowest score is the last item in the array
- parameters.lowestScore = outcomeAvgs[outcomeAvgs.length - 1];
-
- //Test each letter and add the highest to the letters array
- for (var i = 0; i < this.letters.length; i++) {
- let letter = this.letters[i];
-
- if (parameters.lowestScore >= this.params[formula].lowest[letter]) {
- //Able to get this letter
- bestLetter = letter;
-
- //Stop checking for matches since all letters after this are lower
- break;
- }
- }
-
- //Add highest criteria 2 letter to the letters array
- letters.push(bestLetter);
- }
-
- //Get the final letter, the lowest letter from the array
- var letterIndexes = letters.map(letter => this.letters.indexOf(letter)); //Array of letter indexes in this.letters
- var lowestLetterIndex = Math.max(...letterIndexes); //Lowest letter = highest index in this.letters
- var letter = this.letters[lowestLetterIndex]; //Get final letter
-
- return {
- letter: letter,
- parameters: parameters,
- variation: variation
- };
- }
- };
-
- dtpsLMS.gradebook = function (course) {
- return new Promise((resolve, reject) => {
- if (course.gradeCalculation && course.gradeCalculation.dtech) {
- //RENDERER: RENDER GRADE CALCULATION SUMMARY ------------------------------------
- if (course.gradeCalculation.dtech.formula == "2020s1") {
- var gradeCalcSummary = /*html*/`
- <div id="gradeSummary" style="--size: 250px; margin: 0px 20px; --classColor: ${course.color};" class="grid flex">
- <div style="background-color: var(--classColor); color: white;" class="block status letterGrade card">
- <h2 class="main">${course.letter}</h2>
- ${course.previousLetter ? `<h5 class="previousGrade">Previous grade: ${course.previousLetter}</h5>` : ""}
- <h5 class="bottom"><i class="material-icons">grade</i> Grade</h5>
- </div>
- <div class="block status number75">
- <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.number75.toFixed(2)}</h2>
- <h5 class="bottom"><i class="material-icons">functions</i> 75% of outcomes (${course.gradeCalculation.dtech.results.parameters.number75thresh}) ≥</h5>
- </div>
- <div class="block status lowestScore">
- <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.lowestScore.toFixed(2)}</h2>
- <h5 class="bottom"><i class="material-icons">leaderboard</i> Lowest outcome</h5>
- </div>
- </div>
-
- <div style="--classColor: ${course.color};${dtps.gradebookExpanded ? "" : "display: none;"}" id="classGradeMore">
- <br />
- <table class="table">
- <thead>
- <tr>
- <th> Final Letter</th>
- <th>75% (rounded down) of outcome scores is ≥</th>
- <th>No outcome scores below</th>
- </tr>
- </thead>
-
- <tbody>
- ${dtechGradeCalc.letters.map(letter => {
- return /*html*/`
- <tr class="letter${letter} ${course.letter == letter ? `active` : ``}">
- <td> ${letter}</td>
- <td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].percentage[letter]}</td>
- <td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].lowest[letter]}</td>
- </tr>
- `
- }).join("")}
- </tbody>
- </table>
- </div>
-
- <div onclick="$('#classGradeMore').toggle(); if ($('#classGradeMore').is(':visible')) {$(this).children('i').text('keyboard_arrow_up'); $(this).children('span').text('Show less'); dtps.gradebookExpanded = true;} else {$(this).children('i').text('keyboard_arrow_down'); $(this).children('span').text('Show more'); dtps.gradebookExpanded = false;}" class="gradeSummaryShowHide">
- ${dtps.gradebookExpanded ? `<i class="material-icons">keyboard_arrow_up</i> <span>Show less</span>` : `<i class="material-icons">keyboard_arrow_down</i> <span>Show more</span>`}
- </div>
- `;
- } else {
- var gradeCalcSummary = ""; //no grade calculation for this class
- }
-
- //RENDERER: RENDER EACH OUTCOME ------------------------------------
- var outcomeHTML = []; //array of outcome html to be rendered
- var dividerAdded = false; //used for determining if the unassessed outcome divided has been added
- Object.keys(course.gradeCalculation.dtech.outcomes).sort(function (a, b) {
- var keyA = course.gradeCalculation.dtech.outcomes[a].average,//sort by score lowest -> highest
- keyB = course.gradeCalculation.dtech.outcomes[b].average;
- if (keyA == undefined) { keyA = 999999 - course.gradeCalculation.dtech.outcomes[a].scores.length; } //put outcomes with no assessments at the bottom
- if (keyB == undefined) { keyB = 999999 - course.gradeCalculation.dtech.outcomes[b].scores.length; }
- // Compare the 2 scores
- if (keyA > keyB) return 1;
- if (keyA < keyB) return -1;
- return 0;
- }).forEach((outcomeID) => {
- var outcome = course.gradeCalculation.dtech.outcomes[outcomeID];
-
- var divider = !dividerAdded && !outcome.scores.length; //render divider
- if (divider) dividerAdded = true; //remember that divider is already rendered
-
- outcomeHTML.push(/*html*/`
- ${divider ? `<h5 style="font-weight: bold;margin: 75px 75px 10px 75px;">Unassesed outcomes</h5>` : ""}
-
- <div style="border-radius: 20px;padding: 22px; padding-bottom: 20px;" class="card outcomeResults outcome-${outcomeID}">
- <h5 style="max-width: calc(100% - 50px); font-size: 24px; margin: 0px; margin-bottom: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">${outcome.title}</h5>
-
- ${outcome.average !== undefined ? `
- <div id="outcomeScore${outcomeID}" class="numFont" style="position: absolute; top: 20px; right: 20px; font-size: 26px; font-weight: bold; display: inline-block; color: ${dtechRubricColor(outcome.average)}">${outcome.average.toFixed(2)}</div>
- ` : ``}
-
- <div class="assessments">
- ${outcome.scores.length == 0 ? `
- <p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px; color: var(--secText);">This outcome has not been assessed yet</p>
- ` :
- outcome.scores.map((assessment, aIndex) => {
- return /*html*/`
- <div class="assessmentWrapper ${aIndex == outcome.droppedScore ? "dropped" : ""}" id="outcome${assessment.outcome}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
- <div style="color: ${assessment.color};" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore" ${dtps.remoteConfig.allowWhatIfGrades ? `contenteditable` : ""}>${assessment.score}</div>
- <span class="assessmentTitle" style="cursor: pointer;" onclick="dtps.assignment('${assessment.assignmentID}', ${course.num});">${assessment.assignmentTitle}</span>
- </div>
- `;
- }).join("")
- }
- </div>
-
- ${dtps.remoteConfig.allowWhatIfGrades ? /*html*/`
- <p class="addWhatIf" outcomeID="${outcomeID}" style="font-size: 14px; color: var(--secText); margin: 0px; margin-top: 16px; cursor: pointer;">
- <i style="cursor: pointer; vertical-align: middle; font-size: 16px;" class="material-icons down">add_box</i>
- Add a What-If grade
- </p>
- ` : ""}
- </div>
- `);
- })
-
- //RENDERER: RENDER WHAT-IF RESULTS
- var whatIfResults = /*html*/`
- <div style="--classColor: ${course.color}" class="card" id="whatIfResults">
- <div style="display: inline-block;">
- <h5>
- What-If Grade
- <div class="resultLetter">--</div>
- </h5>
- <p style="color: var(--lightText);" class="resultPercentage"></p>
- <p>This grade is hypothetical and does not represent your actual grade for this class.</p>
- <p onclick="fluid.screen();" style="color: var(--secText); cursor: pointer;">Show actual grades</p>
- </div>
- </div>
- `;
-
- //RESOLVE WITH HTML
- resolve(whatIfResults + gradeCalcSummary + `<br />` + outcomeHTML.join(""));
- } else {
- resolve();
- }
- });
- }
-
- //Enable What-If grades
- var scrollListenerAdded = false;
- dtpsLMS.gradebookDidRender = function (course) {
- //Add event listeners for every editable score in the gradebook
- $(".card.outcomeResults .assessments .editableScore").toArray().forEach(ele => {
- listenForWhatIf(ele, course);
- });
-
- //Add event listeners for the "Add a What-If grade" buttons
- $("p.addWhatIf").click(function () {
- addWhatIf(course, $(this).attr("outcomeID"));
- });
-
- //Keep the grade summary on top
- if (!scrollListenerAdded) {
- scrollListenerAdded = true;
- var gradeSummary = document.getElementById("gradeSummary");
- var sticky = gradeSummary.offsetTop - parseFloat($("body").css("padding-top")) - 10;
- window.onscroll = function () {
- if ((window.pageYOffset >= sticky) && ((dtps.classes[dtps.selectedClass]) && (dtps.selectedContent == "grades"))) {
- $(".classContent").addClass("fixedGradeSummary");
- } else {
- $(".classContent").removeClass("fixedGradeSummary");
- }
- };
- }
- }
-
- //Adds a What-If grade listener to the provided element
- var listenForWhatIf = function (ele, course) {
- ele.addEventListener("input", function () {
- //Prepare what-if grades if it's not already prepared
- initWhatIf(course);
-
- //Get new outcome score
- var typedScore = Number($(ele).text());
-
- //Check if score is valid
- if ($(ele).text() && ($(ele).text().length < 4) && !isNaN(typedScore) && (typedScore >= 0) && (typedScore <= 4)) {
- //Valid outcome score, update color to match
- $(ele).css("color", dtechRubricColor(typedScore));
-
- //Check if score is modified
- var isWhatIf = course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].whatIfGrade;
- if (isWhatIf || (typedScore !== course.gradeCalculation.dtech.outcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score)) {
- $(ele).addClass("modified");
- } else {
- $(ele).removeClass("modified");
- }
-
- //Update score in the what-if outcomes
- course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = typedScore;
-
- //Calculate what-if grade
- calcWhatIf(course);
- } else {
- //Invalid outcome score, gray out and calculate without this score
- $(ele).css("color", "var(--secText)");
- $(ele).addClass("modified");
-
- //Update score in the what-if outcomes
- course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
-
- //Calculate what-if grade
- calcWhatIf(course);
- }
-
- }, false);
-
- ele.addEventListener("focus", function () {
- $(ele).addClass("focused");
- }, false);
-
- ele.addEventListener("blur", function () {
- if ($(ele).hasClass("whatIf") && ($(ele).text() == "")) {
- $(ele).parent().remove();
- course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
- } else {
- $(ele).removeClass("focused");
- }
- }, false);
-
- ele.addEventListener("keydown", function (e) {
- function placeCaretAtEnd(el) {
- el.focus();
- if (typeof window.getSelection != "undefined"
- && typeof document.createRange != "undefined") {
- var range = document.createRange();
- range.selectNodeContents(el);
- range.collapse(false);
- var sel = window.getSelection();
- sel.removeAllRanges();
- sel.addRange(range);
- } else if (typeof document.body.createTextRange != "undefined") {
- var textRange = document.body.createTextRange();
- textRange.moveToElementText(el);
- textRange.collapse(false);
- textRange.select();
- }
- }
-
- if (e.key == "ArrowDown") {
- e.preventDefault();
- var scores = $(".editableScore").toArray();
- if (scores[scores.indexOf(ele) + 1]) {
- placeCaretAtEnd(scores[scores.indexOf(ele) + 1]);
- }
- } else if (e.key == "ArrowUp") {
- e.preventDefault();
- var scores = $(".editableScore").toArray();
- if (scores[scores.indexOf(ele) - 1]) {
- placeCaretAtEnd(scores[scores.indexOf(ele) - 1]);
- }
- }
- }, false);
- }
-
- //Copies outcomes for modification, shows what-if UI
- var initWhatIf = function (course) {
- if (!$("#gradeSummary").hasClass("whatIf")) {
- //Initialize what-if grades
-
- //Copy outcomes for modification
- course.gradeCalculation.dtech.whatIfOutcomes = JSON.parse(JSON.stringify(course.gradeCalculation.dtech.outcomes));
-
- //Show what-if mode for grade summary
- $("#gradeSummary .block.card").css("background-color", "");
- $("#gradeSummary .block.card").css("color", "var(--classColor)");
- $("#gradeSummary .block.card h5.bottom").html(`<i class="material-icons">analytics</i> What-If Grade`);
- $("#gradeSummary .block.card .previousGrade").remove();
- $("#gradeSummary .block.card h2.main").after(`<h5 onclick="fluid.screen();" class="showActualGrades">Show actual grades</h5>`);
-
- $("#gradeSummary").addClass("whatIf");
- $("#classGradeMore").addClass("whatIf");
- }
- }
-
- //Calculates what-if grade and updates the UI based on the results
- var calcWhatIf = function (course) {
- if (course.gradeCalculation.dtech.whatIfOutcomes) {
- //Class has what-if outcomes
-
- //Run grade calculation with modified outcomes object
- var results = dtechGradeCalc.run(course.assignments, course.gradeCalculation.dtech.formula, course.gradeCalculation.dtech.whatIfOutcomes);
-
- //Update whatIfOutcomes object with new scores
- course.gradeCalculation.dtech.whatIfOutcomes = results.outcomes;
-
- //Update what-if results card with the grade calculation results
- $("#gradeSummary .block.letterGrade h2.main").html(results.results.letter);
- $("#gradeSummary .block.number75 h2.main").html(results.results.parameters.number75.toFixed(2));
- $("#gradeSummary .block.lowestScore h2.main").html(results.results.parameters.lowestScore.toFixed(2));
- $("#classGradeMore .table tr").removeClass("active");
- $("#classGradeMore .table tr.letter" + results.results.letter).addClass("active");
-
- //Remove dropped state
- $(".card.outcomeResults .dropped").removeClass("dropped");
-
- Object.keys(course.gradeCalculation.dtech.whatIfOutcomes).forEach(outcomeID => {
- var outcome = course.gradeCalculation.dtech.whatIfOutcomes[outcomeID];
-
- //Update outcome average
- if (outcome.average !== undefined) {
- $("#outcomeScore" + outcomeID).html(outcome.average.toFixed(2));
- $("#outcomeScore" + outcomeID).css("color", dtechRubricColor(outcome.average));
- }
-
- //Add dropped state if the score is dropped
- if (outcome.droppedScore !== undefined) {
- $("#outcome" + outcomeID + "assessment" + outcome.droppedScore).addClass("dropped");
- }
- })
- }
- }
-
- //Adds a new score to an outcome
- var addWhatIf = function (course, outcomeID) {
- //Prepare what-if grades if it's not already prepared
- initWhatIf(course);
-
- //Get new assessment index
- var aIndex = course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].scores.length;
-
- //Add new assessment to the outcome
- course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].scores.push({ //most of the stuff in this object is optional but I'm adding it anyways
- id: "whatIf" + aIndex, //if changing this, update the id for the rendered what-if grade assessment as well
- score: null,
- value: 4,
- whatIfGrade: true,
- outcome: outcomeID,
- color: "var(--secText)",
- assignmentTitle: "What-If Grade",
- description: "A What-If grade",
- title: course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].title,
- assignmentID: null
- });
-
- //Add a new What-If assessment to the UI
- $(".card.outcomeResults.outcome-" + outcomeID + " .assessments").append(/*html*/`
- <div class="assessmentWrapper" id="outcome${outcomeID}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
- <div style="color: var(--secText);" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore modified whatIf" contenteditable></div>
- <span class="assessmentTitle">What-If Grade</span>
- </div>
- `);
-
- //Add an event listener for the new score
- listenForWhatIf($(`#outcome${outcomeID}assessment${aIndex} .editableScore`)[0], course);
- }
-});
+/**
+ * @file d.tech-specific features, CBL & grade calculation
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ *
+ * JSDoc documentation for these LMS functions can be found near the end of core.js
+ */
+
+//Get baseURL from the URL of this script
+var baseURL = document.currentScript.src.split("/scripts/lms/dtech.js")[0];
+
+//Load Canvas integration
+jQuery.getScript(baseURL + "/scripts/lms/canvas.js", function () {
+ //Add d.tech-specific items to dtpsLMS
+ dtpsLMS.name = "d.tech";
+ dtpsLMS.legalName = "Canvas LMS, Design Tech High School, or Instructure Inc";
+ dtpsLMS.description = "Power+ integration for Canvas LMS, customized for d.tech";
+ dtpsLMS.logo = "https://i.imgur.com/efGrLq3.png";
+ dtpsLMS.source = "https://github.com/jottocraft/dtps/blob/main/scripts/lms/dtech.js";
+ dtpsLMS.useRubricGrades = true;
+ dtpsLMS.institutionSpecific = true;
+ dtpsLMS.genericGradebook = false;
+ dtpsLMS.dtech = true;
+
+ //Check if due date is usual
+ dtpsLMS.isUsualDueDate = function (date) {
+ var date = new Date(date);
+
+ if (date.getHours() >= 22) {
+ return true;
+ } else if ((date.getHours() == 21) && (date.getMinutes() > 50)) {
+ return true;
+ } else if (date.getHours() < 8) {
+ return true;
+ }
+
+ return false;
+ };
+
+ //Update assignments
+ //This is for customizing rubric names and colors to match d.tech CBL
+ dtpsLMS.updateAssignments = function (rawAssignments) {
+ return new Promise((resolve, reject) => {
+ var updatedAssignments = rawAssignments.map(assignment => {
+ //Check if assignment has rubric
+ if (assignment.rubric) {
+ //Update assignment rubric
+ assignment.rubric.forEach(rubricItem => {
+ rubricItem.scoreName = shortenDtechRubricScoreName(rubricItem.scoreName);
+
+ if (rubricItem.score !== undefined) {
+ rubricItem.color = dtechRubricColor(rubricItem.score);
+ }
+ });
+ }
+
+ //Return updated assignment to the Array.map function
+ return assignment;
+ });
+
+ resolve(updatedAssignments);
+ })
+ }
+
+ //Update classes
+ dtpsLMS.updateClasses = function (classes) {
+ return new Promise((resolve, reject) => {
+ var tmpNewArray = [];
+ classes.forEach((course, i) => {
+ if (course.term == dtps.remoteConfig.dtechCurrentTerm) {
+ tmpNewArray.push(course);
+ } else if (course.id == dtps.remoteConfig.debugClassID) {
+ tmpNewArray.push(course);
+ } else if (!course.endDate || (new Date() < new Date(course.endDate))) {
+ tmpNewArray.push(course);
+ }
+
+ //Check if course is ineligible for videoMeetingURL
+ if (!dtps.remoteConfig.showVideoMeetingButton || dtps.user.parent || !course.homepage || (course.term !== dtps.remoteConfig.dtechCurrentTerm)) {
+ course.videoMeetingURL = null;
+ }
+
+ //Get course period
+ var matches = course.period.match(/[0-9](?=\(A)/);
+ if (matches && matches[0]) {
+ course.period = matches[0] == "7" ? 0 : Number(matches[0]);
+ } else if (/(d|design)(\.| |-)?lab/gi.test(course.subject)) {
+ course.period = 11;
+ } else if (/exploration/gi.test(course.subject)) {
+ course.period = 12;
+ } else {
+ course.period = Infinity;
+ }
+
+ //Get course cycle
+ if (!dtps.user.parent && (window.localStorage.getItem("pref-autoGroupClasses") !== "false")) {
+ if ((course.period >= 1) && (course.period <= 3)) {
+ course.group = "Cycle 1/3";
+ } else if ((course.period >= 4) && (course.period <= 6)) {
+ course.group = "Cycle 2/4";
+ } else if ((course.period == 11) || (course.period == 12)) {
+ course.group = "Intersession";
+ }
+ }
+
+ //Add course icon
+ if (course.id == dtps.remoteConfig.debugClassID) {
+ course.icon = "bug_report";
+ } else if (/Game/gi.test(course.subject)) {
+ course.icon = "games";
+ } else if (/Architecture/gi.test(course.subject)) {
+ course.icon = "architecture";
+ } else if (/History/gi.test(course.subject)) {
+ course.icon = "history_edu";
+ } else if (/Biology/gi.test(course.subject)) {
+ course.icon = "biotech";
+ } else if (/Physics|Science|Chemistry/gi.test(course.subject)) {
+ course.icon = "science";
+ } else if (/Math|Algebra|Geometry|Calculus|Statistics/gi.test(course.subject)) {
+ course.icon = "calculate";
+ } else if (/Engineering|DRG/gi.test(course.subject)) {
+ course.icon = "engineering";
+ } else if (/((d|design)(\.| |-)?lab)|Prototyping/gi.test(course.subject)) {
+ course.icon = "design_services";
+ } else if (/Exploration/gi.test(course.subject)) {
+ course.icon = "explore";
+ } else if (/@d.?tech/gi.test(course.subject)) {
+ course.icon = "school";
+ } else if (/English/gi.test(course.subject)) {
+ course.icon = "description";
+ } else if (/Model( |-|)(United Nations|UN)/gi.test(course.subject)) {
+ course.icon = "public";
+ } else if (/Spanish|Language/gi.test(course.subject)) {
+ course.icon = "translate";
+ } else if (/Government/gi.test(course.subject)) {
+ course.icon = "gavel";
+ } else if (/(Koi|Live)( |-|)Stream/gi.test(course.subject)) {
+ course.icon = "live_tv";
+ } else if (/Film/gi.test(course.subject)) {
+ course.icon = "camera_roll";
+ } else if (/Leadership/gi.test(course.subject)) {
+ course.icon = "stars";
+ } else if (/Athletics/gi.test(course.subject)) {
+ course.icon = "sports_handball";
+ }
+ });
+ classes = tmpNewArray;
+
+ //Automatically sort and group classes if enabled
+ if (!dtps.user.parent && (window.localStorage.getItem("pref-autoGroupClasses") !== "false")) {
+ classes.sort((a, b) => {
+ return a.period - b.period;
+ });
+ }
+
+ resolve(classes);
+ });
+ }
+
+ //Fetch videoMeetingURL for a class
+ dtpsLMS.fetchMeetingURL = function (classID) {
+ return new Promise((resolve, reject) => {
+ var course = dtps.classes.find(course => course.id == classID);
+
+ if (course.homepage && (course.term == dtps.remoteConfig.dtechCurrentTerm)) {
+ dtpsLMS.fetchHomepage(classID).then(homepage => {
+ //get zoom link
+ var meetingURL = null;
+ var matches = 0;
+ for (var i = 0; i < $(homepage).find("a").length; i++) {
+ var link = $($(homepage).find("a")[i]);
+ if (link.children("img").attr("alt") && link.children("img").attr("alt").toUpperCase().includes("ZOOM BUTTON") && link.attr("href")) {
+ //Button labelled as zoom button
+ meetingURL = link.attr("href");
+ } else if (link.attr("href") && link.attr("href").includes("zoom.us")) {
+ //Button link goes to a zoom meeting, only use this if there is no other zoom link
+ //if (!meetingURL) meetingURL = link.attr("href");
+ }
+ }
+
+ if (matches > 1) {
+ //Multiple zoom links found
+ meetingURL = null;
+ }
+
+ resolve(meetingURL);
+ });
+ }
+ })
+ }
+
+ //Run d.tech grade calculation algorithm (defined below)
+ dtpsLMS.calculateGrade = function (course, assignments) {
+ var formula = null;
+
+ //Get d.tech grade calculation formula
+ if (course.term == "20-21") {
+ formula = "2020s1";
+ } else if (String(course.id).includes(dtps.remoteConfig.debugClassID)) {
+ formula = "2020s1";
+ }
+
+ //If there is no grade calculation formula, don't run grade calc
+ if (!formula) return;
+
+ //Run d.tech grade calculation
+ var dtechResults = dtechGradeCalc.run(assignments, formula);
+
+ if (dtechResults) {
+ //Class has a grade
+ return {
+ letter: dtechResults.results.letter,
+ dtech: dtechResults //Return dtech results for gradebook
+ };
+ } else {
+ //No grade for this class
+ return;
+ }
+ }
+
+ //Local functions & variables, not part of the dtpsLMS specification ----------------------------------------------
+
+ //Shortens rubric name for d.tech CBL rubrics
+ var shortenDtechRubricScoreName = function (rating) {
+ if (String(rating).toUpperCase().includes("PIONEERING")) return "Pioneering";
+ if (String(rating).toUpperCase().includes("PROFICIENT")) return "Proficient";
+ if (String(rating).toUpperCase().includes("DEVELOPING")) return "Developing";
+ if (String(rating).toUpperCase().includes("EMERGING")) return "Emerging";
+ if (!String(rating).includes(" ") && (String(rating).length <= 20)) return rating;
+ return "";
+ }
+
+ //Get score color from rubric percentage
+ var dtechRubricColor = function (score) {
+ if (score > 4.0) return "#20D684";
+ if (score == 4.0) return "#41BA35";
+ if (score >= 3.9) return "#50BC39";
+ if (score >= 3.8) return "#5FBD3D";
+ if (score >= 3.7) return "#6EBF40";
+ if (score >= 3.6) return "#7DC044";
+ if (score >= 3.5) return "#8CC248";
+ if (score >= 3.4) return "#9AC44C";
+ if (score >= 3.3) return "#A9C550";
+ if (score >= 3.2) return "#B8C753";
+ if (score >= 3.1) return "#C7C857";
+ if (score >= 3.0) return "#D6CA5B";
+ if (score >= 2.9) return "#D8C35A";
+ if (score >= 2.8) return "#DABB59";
+ if (score >= 2.7) return "#DCB458";
+ if (score >= 2.6) return "#DEAC57";
+ if (score >= 2.5) return "#E1A556";
+ if (score >= 2.4) return "#E39E55";
+ if (score >= 2.3) return "#E59654";
+ if (score >= 2.2) return "#E78F53";
+ if (score >= 2.1) return "#E98752";
+ if (score >= 2.0) return "#EB8051";
+ if (score >= 1.9) return "#E97A50";
+ if (score >= 1.8) return "#E7744F";
+ if (score >= 1.7) return "#E56F4E";
+ if (score >= 1.6) return "#E3694D";
+ if (score >= 1.5) return "#E1634C";
+ if (score >= 1.4) return "#DE5D4A";
+ if (score >= 1.3) return "#DC5749";
+ if (score >= 1.2) return "#DA5248";
+ if (score >= 1.1) return "#D84C47";
+ if (score >= 1.0) return "#D64646";
+ if (score >= 0.0) return "#D72727";
+ if (score < 0.0) return "#BF0000";
+ }
+
+ /**
+ * d.tech CBL grade calculation algorithm
+ *
+ * @property {string[]} letters An array of letters that can be returned from highest -> lowest
+ * @property {object} params Parameters for each type of grade calculation, such as requirements for each criteria
+ */
+ var dtechGradeCalc = {
+ letters: ["A", "A-", "B+", "B", "B-", "C", "I"],
+ params: {
+ /**
+ * @description 2020s1 grade calculation parameters
+ * @property {{string, number}} percentage Percentage criteria parameters. The key of each item in the object is the letter and the value is the percentage needed to meet the criteria
+ * @property {{string, number}} lowest Lowest average criteria perameters. The key of each item in the object is the letter and the value is the lowest average needed to meet the criteria
+ */
+ "2020s1": {
+ percentage: {
+ "A": 3.3,
+ "A-": 3.3,
+ "B+": 2.6,
+ "B": 2.6,
+ "B-": 2.6,
+ "C": 2.2,
+ "I": 0
+ },
+ lowest: {
+ "A": 3,
+ "A-": 2.5,
+ "B+": 2.2,
+ "B": 1.8,
+ "B-": 1.5,
+ "C": 1.5,
+ "I": 0
+ }
+ }
+ },
+ /**
+ * A simple average function
+ *
+ * @param {number[]} array Array of numbers to average
+ * @return {number} Average of the numbers in the array
+ */
+ average: function (array) {
+ var sum = 0;
+ array.forEach(item => sum += item);
+ return sum / array.length;
+ },
+ /**
+ * Runs grade calculation. Takes assignments, gets outcome averages, then calls getLetter to get the final letter.
+ * This function returns undefined if there is no grade.
+ *
+ * @param {Assignment[]} assignments Array of assignments to use for grade calculation
+ * @param {string} formula Formula to use for grade calculation. Can be one of the following: 2020s1
+ * @param {object} outcomesOverride An outcome object to use instead of using assignments. Used for what-if grades.
+ * @return {object} Grade calculation results
+ */
+ run: function (assignments, formula, outcomesOverride) {
+
+ //Array of grade variations
+ var gradeVariations = [];
+
+ //Outcomes object
+ //This doesn't have to be used by the grade calculation formula. Can be overridden for What-If grades.
+ var outcomes = outcomesOverride || {};
+
+ if (formula == "2020s1") {
+ //2020-21 SEMESTER 1 OUTCOME AVERAGE FORMULA (2020s1)
+
+ // ------- [2020s1] Step 1: Get rubric assessments by outcome -------
+
+ if (!outcomesOverride) {
+ assignments.forEach(assignment => {
+ if (assignment.rubric) {
+ //Assignment has a rubric
+
+ assignment.rubric.forEach(rubricItem => {
+ if ((rubricItem.score !== undefined) && rubricItem.outcome) {
+ //Rubric item is assessed and is linked with an outcome
+
+ if (!outcomes[rubricItem.outcome]) {
+ //Outcome object doesn't exist yet
+ outcomes[rubricItem.outcome] = {
+ scores: []
+ };
+ }
+
+ //Add RubricItem to outcome array
+ outcomes[rubricItem.outcome].scores.push(rubricItem);
+
+ //Save outcome name as rubric title
+ if (rubricItem.title) outcomes[rubricItem.outcome].title = rubricItem.title;
+ }
+ });
+ }
+ });
+ }
+
+ // ------- [2020s1] Step 2: Calculate outcome averages -------
+
+ //If there are no outcomes, this class doesn't have a grade
+ if (Object.keys(outcomes).length == 0) return;
+
+ //Loop over the values of each item in the outcomes object
+ Object.values(outcomes).forEach(outcome => {
+ //Get array of scores for the outcome, remove null scores
+ var outcomeScores = outcome.scores.map(RubricItem => RubricItem.score).filter(score => score !== null);
+
+ //Calculate outcome average with all outcome scores
+ var average = this.average(outcomeScores);
+
+ //Get the lowest score
+ var lowestScore = Math.min(...outcomeScores);
+
+ //Drop the lowest score to see what happens
+ var droppedArray = outcomeScores.slice(); //copy of outcomeScores array
+ droppedArray.splice(droppedArray.indexOf(lowestScore), 1); //remove lowest score from array
+
+ var droppedAverage = this.average(droppedArray); //calculate average from droppedArray
+
+ //Choose the higher score
+ if (droppedAverage > average) {
+ //The dropped score was higher
+ outcome.scoreType = "dropped";
+ outcome.droppedScore = outcome.scores.map(RubricItem => RubricItem.score).indexOf(lowestScore);
+ outcome.average = droppedAverage;
+ } else {
+ //Calculating with all outcome scores was the same or higher
+ outcome.scoreType = "all";
+ outcome.average = average;
+ delete outcome.droppedScore;
+ }
+ });
+
+
+ // ------- [2020s1] Step 3: Calculate letter grade variations -------
+
+ //All outcomes variation
+ var outcomeAvgs = Object.values(outcomes).map(outcome => outcome.average);
+ gradeVariations.push(this.getLetter(outcomeAvgs, formula, "all"));
+
+ }
+
+ //Get the highest grade variation from the results
+ var bestVariation = null;
+ gradeVariations.forEach(variation => {
+ if (!bestVariation || (this.letters.indexOf(variation.letter) < this.letters.indexOf(bestVariation.letter))) {
+ //variation.letter is a higher letter than bestVariation.letter, or there is no best variation yet
+ bestVariation = variation;
+ }
+ });
+
+ //Return grade calculation results
+ return {
+ results: bestVariation, //Results for the best variation
+ formula: formula, //Formula used to calculate this grade
+ outcomes: outcomes //Calculated outcome scores
+ };
+ },
+ /**
+ * Calculates a letter grade from an array of outcome averages. Called by gradeCalc.run.
+ * Gets the best possible letter from each criteria, then the lowest letter from that array.
+ *
+ * @param {number[]} outcomeAvgs Array of outcome averages to use for letter grade calculation
+ * @param {string} formula Formula to use for grade calculation. See gradeCalc.run.
+ * @param {string} [variation] Name of the letter grade variation (e.g. withSS, withoutSS, etc.). Only used for formulas with multiple variations.
+ * @return {object} Letter grade calculation results
+ */
+ getLetter: function (outcomeAvgs, formula, variation) {
+ //Grade calculation results object
+ //This includes any properties that need to be passed to the gradebook. The properties set depend on the formula.
+ var parameters = {};
+
+ //Sort outcome averages highest -> lowest
+ outcomeAvgs.sort((a, b) => b - a);
+
+ if (formula == "2020s1") {
+ //2020-21 SEMESTER 1 LETTER GRADE FORMULA (2020s1)
+
+ //Array of letters from each criteria
+ var letters = [];
+
+ // ------- [2020s1] Step 1: Get highest letter for Criteria 1 (percentage of outcomes criteria) -------
+ var percentage = .75;
+ var numOutcomesRequired = Math.floor(outcomeAvgs.length * percentage); //Minimum number of outcomes required
+
+ //Calculate the value 75% of outcomes >= to (number75) and the number of outcomes needed to meet criteria 1
+ if (outcomeAvgs.length == 1) {
+ parameters.number75 = outcomeAvgs[0]; //if there is only 1 outcome, that outcome is number75
+ } else {
+ parameters.number75 = outcomeAvgs[numOutcomesRequired - 1]; //number75 = the outcome 75% through the array (since its sorted)
+ }
+ parameters.number75thresh = numOutcomesRequired; //number75thresh = number of outcomes needed to meet the criteria
+
+ //Get the best letter
+ var bestLetter = null;
+
+ //Test each letter and add the highest to the letters array
+ for (var i = 0; i < this.letters.length; i++) {
+ let letter = this.letters[i];
+
+ if (parameters.number75 >= this.params[formula].percentage[letter]) {
+ //Able to get this letter
+ bestLetter = letter;
+
+ //Stop checking for matches since all letters after this are lower
+ break;
+ }
+ }
+
+ //Add highest criteria 1 letter to the letters array
+ letters.push(bestLetter);
+
+ // ------- [2020s1] Step 2: Get highest letter for Criteria 2 (lowest outcome criteria) -------
+
+ //Reset best letter
+ var bestLetter = null;
+
+ //Since the array is highest -> lowest, the lowest score is the last item in the array
+ parameters.lowestScore = outcomeAvgs[outcomeAvgs.length - 1];
+
+ //Test each letter and add the highest to the letters array
+ for (var i = 0; i < this.letters.length; i++) {
+ let letter = this.letters[i];
+
+ if (parameters.lowestScore >= this.params[formula].lowest[letter]) {
+ //Able to get this letter
+ bestLetter = letter;
+
+ //Stop checking for matches since all letters after this are lower
+ break;
+ }
+ }
+
+ //Add highest criteria 2 letter to the letters array
+ letters.push(bestLetter);
+ }
+
+ //Get the final letter, the lowest letter from the array
+ var letterIndexes = letters.map(letter => this.letters.indexOf(letter)); //Array of letter indexes in this.letters
+ var lowestLetterIndex = Math.max(...letterIndexes); //Lowest letter = highest index in this.letters
+ var letter = this.letters[lowestLetterIndex]; //Get final letter
+
+ return {
+ letter: letter,
+ parameters: parameters,
+ variation: variation
+ };
+ }
+ };
+
+ dtpsLMS.gradebook = function (course) {
+ return new Promise((resolve, reject) => {
+ if (course.gradeCalculation && course.gradeCalculation.dtech) {
+ //RENDERER: RENDER GRADE CALCULATION SUMMARY ------------------------------------
+ if (course.gradeCalculation.dtech.formula == "2020s1") {
+ var gradeCalcSummary = /*html*/`
+ <div id="gradeSummary" style="--size: 250px; margin: 0px 20px; --classColor: ${course.color};" class="grid flex">
+ <div style="background-color: var(--classColor); color: white;" class="block status letterGrade card">
+ <h2 class="main">${course.letter}</h2>
+ ${course.previousLetter ? `<h5 class="previousGrade">Previous grade: ${course.previousLetter}</h5>` : ""}
+ <h5 class="bottom"><i class="fluid-icon">grade</i> Grade</h5>
+ </div>
+ <div class="block status number75">
+ <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.number75.toFixed(2)}</h2>
+ <h5 class="bottom"><i class="fluid-icon">functions</i> 75% of outcomes (${course.gradeCalculation.dtech.results.parameters.number75thresh}) ≥</h5>
+ </div>
+ <div class="block status lowestScore">
+ <h2 class="main numFont">${course.gradeCalculation.dtech.results.parameters.lowestScore.toFixed(2)}</h2>
+ <h5 class="bottom"><i class="fluid-icon">leaderboard</i> Lowest outcome</h5>
+ </div>
+ </div>
+
+ <div style="--classColor: ${course.color};${dtps.gradebookExpanded ? "" : "display: none;"}" id="classGradeMore">
+ <br />
+ <table class="table">
+ <thead>
+ <tr>
+ <th> Final Letter</th>
+ <th>75% (rounded down) of outcome scores is ≥</th>
+ <th>No outcome scores below</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ ${dtechGradeCalc.letters.map(letter => {
+ return /*html*/`
+ <tr class="letter${letter} ${course.letter == letter ? `active` : ``}">
+ <td> ${letter}</td>
+ <td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].percentage[letter]}</td>
+ <td>${dtechGradeCalc.params[course.gradeCalculation.dtech.formula].lowest[letter]}</td>
+ </tr>
+ `
+ }).join("")}
+ </tbody>
+ </table>
+ </div>
+
+ <div onclick="$('#classGradeMore').toggle(); if ($('#classGradeMore').is(':visible')) {$(this).children('i').text('keyboard_arrow_up'); $(this).children('span').text('Show less'); dtps.gradebookExpanded = true;} else {$(this).children('i').text('keyboard_arrow_down'); $(this).children('span').text('Show more'); dtps.gradebookExpanded = false;}" class="gradeSummaryShowHide">
+ ${dtps.gradebookExpanded ? `<i class="fluid-icon">keyboard_arrow_up</i> <span>Show less</span>` : `<i class="fluid-icon">keyboard_arrow_down</i> <span>Show more</span>`}
+ </div>
+ `;
+ } else {
+ var gradeCalcSummary = ""; //no grade calculation for this class
+ }
+
+ //RENDERER: RENDER EACH OUTCOME ------------------------------------
+ var outcomeHTML = []; //array of outcome html to be rendered
+ var dividerAdded = false; //used for determining if the unassessed outcome divided has been added
+ Object.keys(course.gradeCalculation.dtech.outcomes).sort(function (a, b) {
+ var keyA = course.gradeCalculation.dtech.outcomes[a].average,//sort by score lowest -> highest
+ keyB = course.gradeCalculation.dtech.outcomes[b].average;
+ if (keyA == undefined) { keyA = 999999 - course.gradeCalculation.dtech.outcomes[a].scores.length; } //put outcomes with no assessments at the bottom
+ if (keyB == undefined) { keyB = 999999 - course.gradeCalculation.dtech.outcomes[b].scores.length; }
+ // Compare the 2 scores
+ if (keyA > keyB) return 1;
+ if (keyA < keyB) return -1;
+ return 0;
+ }).forEach((outcomeID) => {
+ var outcome = course.gradeCalculation.dtech.outcomes[outcomeID];
+
+ var divider = !dividerAdded && !outcome.scores.length; //render divider
+ if (divider) dividerAdded = true; //remember that divider is already rendered
+
+ outcomeHTML.push(/*html*/`
+ ${divider ? `<h5 style="font-weight: bold;margin: 75px 75px 10px 75px;">Unassesed outcomes</h5>` : ""}
+
+ <div style="border-radius: 20px;padding: 22px; padding-bottom: 20px;" class="card outcomeResults outcome-${outcomeID}">
+ <h5 style="max-width: calc(100% - 50px); font-size: 24px; margin: 0px; margin-bottom: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">${outcome.title}</h5>
+
+ ${outcome.average !== undefined ? `
+ <div id="outcomeScore${outcomeID}" class="numFont" style="position: absolute; top: 20px; right: 20px; font-size: 26px; font-weight: bold; display: inline-block; color: ${dtechRubricColor(outcome.average)}">${outcome.average.toFixed(2)}</div>
+ ` : ``}
+
+ <div class="assessments">
+ ${outcome.scores.length == 0 ? `
+ <p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px; color: var(--secText);">This outcome has not been assessed yet</p>
+ ` :
+ outcome.scores.map((assessment, aIndex) => {
+ return /*html*/`
+ <div class="assessmentWrapper ${aIndex == outcome.droppedScore ? "dropped" : ""}" id="outcome${assessment.outcome}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
+ <div style="color: ${assessment.color};" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore" ${dtps.remoteConfig.allowWhatIfGrades ? `contenteditable` : ""}>${assessment.score}</div>
+ <span class="assessmentTitle" style="cursor: pointer;" onclick="dtps.assignment('${assessment.assignmentID}', ${course.num});">${assessment.assignmentTitle}</span>
+ </div>
+ `;
+ }).join("")
+ }
+ </div>
+
+ ${dtps.remoteConfig.allowWhatIfGrades ? /*html*/`
+ <p class="addWhatIf" outcomeID="${outcomeID}" style="font-size: 14px; color: var(--secText); margin: 0px; margin-top: 16px; cursor: pointer;">
+ <i style="cursor: pointer; vertical-align: middle; font-size: 16px;" class="fluid-icon down">add_box</i>
+ Add a What-If grade
+ </p>
+ ` : ""}
+ </div>
+ `);
+ })
+
+ //RENDERER: RENDER WHAT-IF RESULTS
+ var whatIfResults = /*html*/`
+ <div style="--classColor: ${course.color}" class="card" id="whatIfResults">
+ <div style="display: inline-block;">
+ <h5>
+ What-If Grade
+ <div class="resultLetter">--</div>
+ </h5>
+ <p style="color: var(--lightText);" class="resultPercentage"></p>
+ <p>This grade is hypothetical and does not represent your actual grade for this class.</p>
+ <p onclick="fluid.screen();" style="color: var(--secText); cursor: pointer;">Show actual grades</p>
+ </div>
+ </div>
+ `;
+
+ //RESOLVE WITH HTML
+ resolve(whatIfResults + gradeCalcSummary + `<br />` + outcomeHTML.join(""));
+ } else {
+ resolve();
+ }
+ });
+ }
+
+ //Enable What-If grades
+ var scrollListenerAdded = false;
+ dtpsLMS.gradebookDidRender = function (course) {
+ //Add event listeners for every editable score in the gradebook
+ $(".card.outcomeResults .assessments .editableScore").toArray().forEach(ele => {
+ listenForWhatIf(ele, course);
+ });
+
+ //Add event listeners for the "Add a What-If grade" buttons
+ $("p.addWhatIf").click(function () {
+ addWhatIf(course, $(this).attr("outcomeID"));
+ });
+
+ //Keep the grade summary on top
+ if (!scrollListenerAdded) {
+ scrollListenerAdded = true;
+ var gradeSummary = document.getElementById("gradeSummary");
+ var sticky = gradeSummary.offsetTop - parseFloat($("body").css("padding-top")) - 10;
+ window.onscroll = function () {
+ if ((window.pageYOffset >= sticky) && ((dtps.classes[dtps.selectedClass]) && (dtps.selectedContent == "grades"))) {
+ $(".classContent").addClass("fixedGradeSummary");
+ } else {
+ $(".classContent").removeClass("fixedGradeSummary");
+ }
+ };
+ }
+ }
+
+ //Adds a What-If grade listener to the provided element
+ var listenForWhatIf = function (ele, course) {
+ ele.addEventListener("input", function () {
+ //Prepare what-if grades if it's not already prepared
+ initWhatIf(course);
+
+ //Get new outcome score
+ var typedScore = Number($(ele).text());
+
+ //Check if score is valid
+ if ($(ele).text() && ($(ele).text().length < 4) && !isNaN(typedScore) && (typedScore >= 0) && (typedScore <= 4)) {
+ //Valid outcome score, update color to match
+ $(ele).css("color", dtechRubricColor(typedScore));
+
+ //Check if score is modified
+ var isWhatIf = course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].whatIfGrade;
+ if (isWhatIf || (typedScore !== course.gradeCalculation.dtech.outcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score)) {
+ $(ele).addClass("modified");
+ } else {
+ $(ele).removeClass("modified");
+ }
+
+ //Update score in the what-if outcomes
+ course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = typedScore;
+
+ //Calculate what-if grade
+ calcWhatIf(course);
+ } else {
+ //Invalid outcome score, gray out and calculate without this score
+ $(ele).css("color", "var(--secText)");
+ $(ele).addClass("modified");
+
+ //Update score in the what-if outcomes
+ course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
+
+ //Calculate what-if grade
+ calcWhatIf(course);
+ }
+
+ }, false);
+
+ ele.addEventListener("focus", function () {
+ $(ele).addClass("focused");
+ }, false);
+
+ ele.addEventListener("blur", function () {
+ if ($(ele).hasClass("whatIf") && ($(ele).text() == "")) {
+ $(ele).parent().remove();
+ course.gradeCalculation.dtech.whatIfOutcomes[Number($(ele).attr("outcomeID"))].scores[Number($(ele).attr("aIndex"))].score = null;
+ } else {
+ $(ele).removeClass("focused");
+ }
+ }, false);
+
+ ele.addEventListener("keydown", function (e) {
+ function placeCaretAtEnd(el) {
+ el.focus();
+ if (typeof window.getSelection != "undefined"
+ && typeof document.createRange != "undefined") {
+ var range = document.createRange();
+ range.selectNodeContents(el);
+ range.collapse(false);
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+ } else if (typeof document.body.createTextRange != "undefined") {
+ var textRange = document.body.createTextRange();
+ textRange.moveToElementText(el);
+ textRange.collapse(false);
+ textRange.select();
+ }
+ }
+
+ if (e.key == "ArrowDown") {
+ e.preventDefault();
+ var scores = $(".editableScore").toArray();
+ if (scores[scores.indexOf(ele) + 1]) {
+ placeCaretAtEnd(scores[scores.indexOf(ele) + 1]);
+ }
+ } else if (e.key == "ArrowUp") {
+ e.preventDefault();
+ var scores = $(".editableScore").toArray();
+ if (scores[scores.indexOf(ele) - 1]) {
+ placeCaretAtEnd(scores[scores.indexOf(ele) - 1]);
+ }
+ }
+ }, false);
+ }
+
+ //Copies outcomes for modification, shows what-if UI
+ var initWhatIf = function (course) {
+ if (!$("#gradeSummary").hasClass("whatIf")) {
+ //Initialize what-if grades
+
+ //Copy outcomes for modification
+ course.gradeCalculation.dtech.whatIfOutcomes = JSON.parse(JSON.stringify(course.gradeCalculation.dtech.outcomes));
+
+ //Show what-if mode for grade summary
+ $("#gradeSummary .block.card").css("background-color", "");
+ $("#gradeSummary .block.card").css("color", "var(--classColor)");
+ $("#gradeSummary .block.card h5.bottom").html(`<i class="fluid-icon">analytics</i> What-If Grade`);
+ $("#gradeSummary .block.card .previousGrade").remove();
+ $("#gradeSummary .block.card h2.main").after(`<h5 onclick="fluid.screen();" class="showActualGrades">Show actual grades</h5>`);
+
+ $("#gradeSummary").addClass("whatIf");
+ $("#classGradeMore").addClass("whatIf");
+ }
+ }
+
+ //Calculates what-if grade and updates the UI based on the results
+ var calcWhatIf = function (course) {
+ if (course.gradeCalculation.dtech.whatIfOutcomes) {
+ //Class has what-if outcomes
+
+ //Run grade calculation with modified outcomes object
+ var results = dtechGradeCalc.run(course.assignments, course.gradeCalculation.dtech.formula, course.gradeCalculation.dtech.whatIfOutcomes);
+
+ //Update whatIfOutcomes object with new scores
+ course.gradeCalculation.dtech.whatIfOutcomes = results.outcomes;
+
+ //Update what-if results card with the grade calculation results
+ $("#gradeSummary .block.letterGrade h2.main").html(results.results.letter);
+ $("#gradeSummary .block.number75 h2.main").html(results.results.parameters.number75.toFixed(2));
+ $("#gradeSummary .block.lowestScore h2.main").html(results.results.parameters.lowestScore.toFixed(2));
+ $("#classGradeMore .table tr").removeClass("active");
+ $("#classGradeMore .table tr.letter" + results.results.letter).addClass("active");
+
+ //Remove dropped state
+ $(".card.outcomeResults .dropped").removeClass("dropped");
+
+ Object.keys(course.gradeCalculation.dtech.whatIfOutcomes).forEach(outcomeID => {
+ var outcome = course.gradeCalculation.dtech.whatIfOutcomes[outcomeID];
+
+ //Update outcome average
+ if (outcome.average !== undefined) {
+ $("#outcomeScore" + outcomeID).html(outcome.average.toFixed(2));
+ $("#outcomeScore" + outcomeID).css("color", dtechRubricColor(outcome.average));
+ }
+
+ //Add dropped state if the score is dropped
+ if (outcome.droppedScore !== undefined) {
+ $("#outcome" + outcomeID + "assessment" + outcome.droppedScore).addClass("dropped");
+ }
+ })
+ }
+ }
+
+ //Adds a new score to an outcome
+ var addWhatIf = function (course, outcomeID) {
+ //Prepare what-if grades if it's not already prepared
+ initWhatIf(course);
+
+ //Get new assessment index
+ var aIndex = course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].scores.length;
+
+ //Add new assessment to the outcome
+ course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].scores.push({ //most of the stuff in this object is optional but I'm adding it anyways
+ id: "whatIf" + aIndex, //if changing this, update the id for the rendered what-if grade assessment as well
+ score: null,
+ value: 4,
+ whatIfGrade: true,
+ outcome: outcomeID,
+ color: "var(--secText)",
+ assignmentTitle: "What-If Grade",
+ description: "A What-If grade",
+ title: course.gradeCalculation.dtech.whatIfOutcomes[outcomeID].title,
+ assignmentID: null
+ });
+
+ //Add a new What-If assessment to the UI
+ $(".card.outcomeResults.outcome-" + outcomeID + " .assessments").append(/*html*/`
+ <div class="assessmentWrapper" id="outcome${outcomeID}assessment${aIndex}" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0px;">
+ <div style="color: var(--secText);" aIndex="${aIndex}" outcomeID="${outcomeID}" class="editableScore modified whatIf" contenteditable></div>
+ <span class="assessmentTitle">What-If Grade</span>
+ </div>
+ `);
+
+ //Add an event listener for the new score
+ listenForWhatIf($(`#outcome${outcomeID}assessment${aIndex} .editableScore`)[0], course);
+ }
+});
diff --git a/scripts/pages-discussions.js b/scripts/pages-discussions.js
index 3a72571..1685b7e 100644
--- a/scripts/pages-discussions.js
+++ b/scripts/pages-discussions.js
@@ -1,576 +1,576 @@
-/**
- * @file DTPS pages & discussion functions
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-
-/**
- * Renders the discussions list for a class
- *
- * @param {string} courseID The course ID to render discussion threads for
- * @param {string} [defaultThread] The thread to load by default
- * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
- * @param {string} [defaultPost] The post to load by default
- */
-dtps.loadThreadsList = function (courseID, defaultThread, fromModules, defaultPost) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
- dtps.selectedClass = classNum;
-
- //Set discussions as the selected content
- if (!fromModules) {
- dtps.selectedContent = "discuss";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.discuss").addClass("active");
- jQuery("body").removeClass("collapsedSidebar");
- }
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadThreadsList");
- }
-
- //Load class color and things
- dtps.presentClass(classNum);
-
- //Load module thread
- if (fromModules) {
- dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
- return;
- }
-
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
- //Render sidebar
- jQuery(".sidebar").html(/*html*/`
- <div class="title">
- <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">forum</i>
- <h4>Discussions</h4>
- </div>
-
- <div class="items">
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
- </div>
-
- <div class="divider"></div>
-
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Discussion thread Title</span>
- </div>
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Discussion thread Title</span>
- </div>
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Discussion thread Title</span>
- </div>
- </div>
- `);
-
- //Delete existing class content HTML
- jQuery(".classContent").html("");
- }
-
- //Fetch discussion thread data
- dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].lmsID).then(function (threadData) {
- //Store fetched data to the selected class
- dtps.classes[classNum].discussions = threadData;
-
- if (dtps.classes[classNum].discussions.length == 0) {
- //No discussion topics in this class
- jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
- </div>
-
- <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No discussions found</p>
- <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any discussions</p>
- `);
- } else {
- //Loop over discusson threads array to create discussion thread HTML for the sidebar
- var discussionHTML = dtps.classes[classNum].discussions.map(discussionThread => {
- return /*html*/`
- <div data-threadID="${discussionThread.id}" class="item">
- <i class="material-icons">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}</i>
- <span class="label">${discussionThread.title}</span>
- </div>
- `;
- }).join("");
-
- //Render discussion threads in the sidebar
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
- jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
- </div>
-
- ${
- dtps.classes[classNum].newDiscussionThreadURL ? (/*html*/`
- <div onclick="window.open('${dtps.classes[classNum].newDiscussionThreadURL}')" class="item back">
- <i class="material-icons">add</i>
- <span class="label">New discussion</span>
- </div>
- `) : ""
- }
-
- <div class="divider"></div>
-
- ${discussionHTML}
- `);
-
- //Load default thread if provided
- if (defaultThread) {
- dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
- }
-
- //Add click event listeners for discussion threads
- $(".sidebar .item:not(.back)").click(function (event) {
- //Show the selected thread as active
- $(this).siblings().removeClass("active");
- $(this).addClass("active");
-
- //Get thread ID from HTML attribute
- var postID = $(this).attr("data-threadID");
-
- //Load the thread
- dtps.loadThreadPosts(classNum, postID);
- });
- }
- }
-
- }).catch(function (err) {
- dtps.error("Couldn't fetch discussion threads", "Caught promise rejection @ dtps.loadThreadsList", err);
- });
-}
-
-/**
- * Fetches and displays posts in a discussion
- *
- * @param {number} classNum The class number to render
- * @param {string} threadID The discussion thread to render
- * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
- * @param {string} [defaultPost] The post ID to jump to
- */
-dtps.loadThreadPosts = function (classNum, threadID, fromModules, defaultPost) {
- //Show loading indicator
- if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
- jQuery(".classContent").html(/*html*/`
- <div class="card" style="margin-top: 20px;margin-bottom: 75px;">
- <h4><span class="shimmer">[SHIMMER] Thread Title</span></h4>
-
- <div style="margin-bottom: 32px;" class="discussionHeader">
- <h5 ><span class="shimmer">Discussion author name</span></h5>
-
- <i class="material-icons shimmer">calendar_today</i>
- <span class="shimmer">Discussion date</span>
- </div>
-
- <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 400px; border: none; outline: none;"></div>
-
- <div style="margin-top: 32px;" class="discussionFooter">
- <button class="btn small shimmer"><i class="material-icons">post_add</i> Add Post</button>
- </div>
- </div>
- `);
- }
-
- //Fetch discussion posts from the LMS
- dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].lmsID, threadID).then(function (thread) {
- //Post HTML array
- var postHTML = [];
-
- thread.posts.forEach((post, index) => {
- //Get background and text color for iFrame content
- var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
- var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
-
- //Create a new blob data URL with the post's content
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
- ${post.body}
- `], { type: 'text/html' });
- var discussionPostContentURL = window.URL.createObjectURL(blob);
-
- //Create HTML for replies
- var replyHTML = [];
- if (post.replies) {
- //Add space above replies
- replyHTML.push(`<br />`);
-
- //Get HTML for each reply and add to array
- post.replies.forEach(reply => {
- replyHTML.push(/*html*/`
- <div data-post-id="${reply.id}" style="margin-left: ${(reply.depth || 0) * 50}px;" class="discussionReply">
- <div class="discussionHeader">
- ${post.author ? /*html*/`
- <img src="${reply.author.photoURL}" />
- <h5>${reply.author.name}</h5>
- ` : ``}
-
- <span style="cursor: pointer;" onclick="window.open('${reply.replyURL}')">
- <i class="material-icons">reply</i>
- <span>Reply</span>
- </span>
- </div>
-
- ${reply.body}
- </div>
- `)
- });
-
- //Add space below replies
- replyHTML.push(`<br />`);
- }
-
- //Create HTML for this post
- //Note that index == 0 is the initial post
- postHTML.push(/*html*/`
- <div class="card" data-post-id="${post.id}" style="margin-top: 20px;${index == 0 ? "margin-bottom: 75px;" : "padding: 20px 30px;"}">
- <!-- Thread title (Initial post) -->
- ${index == 0 ? /*html*/`
- <h4 style="font-weight: bold">${thread.title}</h4>
- ` : ''}
-
- <!-- Author header -->
- <div ${index == 0 ? `style="margin-bottom: 32px;"` : ""} class="discussionHeader">
- ${post.author ? /*html*/`
- <img src="${post.author.photoURL}" />
- <h5>${post.author.name}</h5>
- ` : ``}
-
- <i class="material-icons">calendar_today</i>
- <span>${dtps.formatDate(post.postedAt)}</span>
-
- <!-- Thread info (initial post) -->
- ${index == 0 ? /*html*/`
- ${thread.locked ? `<i class="material-icons">lock</i>` : ""}
- ${thread.requireInitialPost ? /*html*/`
- <i class="material-icons">visibility</i>
- <span>You must post before you can see other replies</span>
- ` : ""}
- ` : ''}
- </div>
-
- ${index == 0 ? /*html*/`
- <iframe id="classThreadIframe" onload="dtps.iframeLoad('classThreadIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${discussionPostContentURL}" />
- ` : post.body}
-
- ${replyHTML.join("")}
-
- <!-- Reply / Add post footer -->
- ${post.replyURL ? /*html*/`
- <div ${index == 0 ? `style="margin-top: 32px;"` : ""} class="discussionFooter">
- ${index == 0 ? /*html*/`
- <button onclick="window.open('${post.replyURL}')" class="btn small"><i class="material-icons">post_add</i> Add Post</button>
- ` : /*html*/`
- <button onclick="window.open('${post.replyURL}')" class="btn small"><i class="material-icons">reply</i> Reply</button>
- `}
- </div>
- ` : ""}
- </div>
- `);
- });
-
- //Render HTML
- if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
- jQuery(".classContent").html((fromModules ? /*html*/`
- <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
- <i class="material-icons">keyboard_arrow_left</i> Back
- </button>
- ` : "") + postHTML.join(""));
-
- //Jump to post if specified
- if (defaultPost) {
- $("[data-post-id=" + defaultPost + "]").get(0).scrollIntoView();
- }
- }
- }).catch(function (err) {
- dtps.error("Could not fetch discussion posts", "Caught promise rejection @ dtps.loadThreadPosts", err);
- });
-}
-
-/**
- * Renders the pages list for a class
- *
- * @param {string} courseID The course ID to render pages for
- * @param {string} [defaultPage] If provided, load the pageID by default
- * @param {boolean} fromModules True if this page is being loaded from the moduleStream
- */
-dtps.loadPagesList = function (courseID, defaultPage, fromModules) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
- dtps.selectedClass = classNum;
-
- //Set pages as the selected content
- if (!fromModules) {
- dtps.selectedContent = "pages";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.pages").addClass("active");
- jQuery("body").removeClass("collapsedSidebar");
- }
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadPagesList");
- }
-
- //Load class color and things
- dtps.presentClass(classNum);
-
- //Load module page
- if (fromModules) {
- dtps.loadPage(classNum, defaultPage, fromModules);
- return;
- }
-
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
- //Render sidebar
- jQuery(".sidebar").html(/*html*/`
- <div class="title">
- <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="material-icons">insert_drive_file</i>
- <h4>Pages</h4>
- </div>
-
- <div class="items">
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i> <span class="label">Classes</span>
- </div>
-
- <div class="divider"></div>
-
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Class page title</span>
- </div>
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Class page title</span>
- </div>
- <div class="item shimmerParent">
- <i class="material-icons">star</i>
- <span class="label">Class page title</span>
- </div>
- </div>
- `);
-
- //Delete existing class content HTML
- jQuery(".classContent").html("");
- }
-
- dtpsLMS.fetchPages(dtps.classes[classNum].lmsID).then(function (pagesData) {
- //Store fetched pages data to the class
- dtps.classes[classNum].pages = pagesData;
-
- if (pagesData.length == 0) {
- //No pages in this class
- jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i>
- <span class="label">Classes</span>
- </div>
-
- <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No pages found</p>
- <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any pages</p>
- `);
- } else {
- //Loop over discusson threads array to create discussion thread HTML for the sidebar
- var pageHTML = dtps.classes[classNum].pages.map(page => {
- return /*html*/`
- <div data-pageID="${page.id}" class="item ${(defaultPage && (page.id == defaultPage)) ? "active" : ""}">
- <i class="material-icons">insert_drive_file</i>
- <span class="label">${page.title}</span>
- </div>
- `;
- }).join("");
-
- //Render discussion threads in the sidebar
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
- jQuery(".sidebar .items").html(/*html*/`
- <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
- <i class="material-icons">keyboard_arrow_left</i>
- <span class="label">Classes</span>
- </div>
-
- <div class="divider"></div>
-
- ${pageHTML}
- `);
- }
-
- //Load default page if provided
- if (defaultPage) {
- dtps.loadPage(classNum, defaultPage);
- }
-
- //Add click event listeners for pages
- $(".sidebar .item:not(.back)").click(function (event) {
- //Show the selected thread as active
- $(this).siblings().removeClass("active");
- $(this).addClass("active");
-
- //Get page ID from HTML attribute
- var pageID = $(this).attr("data-pageID");
-
- //Load the page content
- dtps.loadPage(classNum, pageID);
- });
- }
- }).catch((err) => {
- dtps.error("Couldn't fetch pages", "Caught promise rejection @ dtps.loadPagesList", err);
- });
-}
-
-/**
- * Fetches and renders a page and its contents
- *
- * @param {string} classNum The class number of the page to render
- * @param {string} pageID The page ID to render
- * @param {boolean} fromModules True if this page is being loaded from the moduleStream
- */
-dtps.loadPage = function (classNum, pageID, fromModules) {
- //Show loading indicator
- if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
- jQuery(".classContent").html(/*html*/`
- <div style="margin: 20px; padding: 20px;">
- <h4><span class="shimmer">[SHIMMER] Class page title</span></h4>
-
- <div style="margin-bottom: 32px;" class="discussionHeader">
- <h5 class="shimmer">Page author name</h5>
-
- <i class="material-icons shimmer">calendar_today</i>
- <span class="shimmer">[SHIMMER] Last updated at</span>
- </div>
-
- <!-- Page content -->
- <br />
- <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 600px; border: none; outline: none;"></div>
- </div>
- `);
- }
-
- //Fetch page content
- dtpsLMS.fetchPageContent(dtps.classes[classNum].lmsID, pageID).then(function (page) {
- if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
- //Get computed background and text color to style the iFrame with
- var computedBackgroundColor = getComputedStyle($(".classContent")[0]).getPropertyValue("--background");
- var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
-
- //Generate a blob with the page content and get its data URL
- var blob = new Blob([`
- <base target="_blank" />
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
- <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
- ${page.content}
- `], { type: 'text/html' });
-
- //Get URL from blob
- var pageContentURL = window.URL.createObjectURL(blob);
-
- //Render page card in the class content
- jQuery(".classContent").html(/*html*/`
- ${fromModules ? /*html*/`
- <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
- <i class="material-icons">keyboard_arrow_left</i> Back
- </button>
- ` : ""}
- <div style="margin: 20px; padding: 20px;">
- <!-- Page title -->
- <h4 style="font-weight: bold;">${page.title}</h4>
-
- <!-- Page header -->
- <div style="margin-bottom: 32px;" class="discussionHeader">
- ${page.author ? /*html*/`
- <img src="${page.author.photoURL}" />
- <h5>${page.author.name}</h5>
- ` : ``}
-
- <i class="material-icons">calendar_today</i>
- <span>${"Last Updated " + dtps.formatDate(page.updatedAt)}</span>
- </div>
-
- <!-- Page content -->
- <br />
- <iframe id="classPageIframe" onload="dtps.iframeLoad('classPageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${pageContentURL}" />
- </div>
- `);
- }
- }).catch((err) => {
- dtps.error("Couldn't load page", "Caught promise rejection @ dtps.loadPage", err);
- });
-}
-
-//Fluid UI screen definitions
-fluid.externalScreens.discussions = (param) => {
- //Split parameter string into variables
- var courseID = param.split("|")[0];
- var threadID = param.split("|")[1];
- var fromModules = param.split("|")[2] == "true";
- var postID = param.split("|")[3];
-
- dtps.loadThreadsList(courseID, threadID, fromModules, postID);
-}
-
-fluid.externalScreens.pages = (param) => {
- //Split parameter string into variables
- var courseID = param.split("|")[0];
- var pageID = param.split("|")[1];
- var fromModules = param.split("|")[2] == "true";
-
- dtps.loadPagesList(courseID, pageID, fromModules);
-}
-
-//Type definitions
-
-/**
-* @typedef {Object} PartialDiscussionThread
-* @description Defines partial discussion thread objects in DTPS (for threads list)
-* @property {string} title Title of the discussion thread
-* @property {string} id Discussion thread ID
-* @property {boolean} [locked] True if posting to the discussion thread is locked
-*/
-
-/**
-* @typedef {Object} DiscussionThread
-* @description Defines discussion thread objects in DTPS
-* @property {string} title Title of the discussion thread
-* @property {string} id Discussion thread ID
-* @property {DiscussionPost[]} posts Posts in this thread, with the initial one first.
-* @property {boolean} [locked] True if posting to the discussion thread is locked
-* @property {boolean} [requireInitialPost] True if the user must post before viewing others' posts
-*/
-
-/**
-* @typedef {Object} DiscussionPost
-* @description Defines discussion post objects in DTPS
-* @property {string} id Discussion post ID
-* @property {string} body Discussion post body HTML
-* @property {Date} postedAt Date for when the post was posted
-* @property {number} [depth] The depth level this post is
-* @property {User} [author] Discussion post author
-* @property {DiscussionPost[]} [replies] Replies to this post. Nested replies (replies to replies) should be after this post in the array with a depth of 1, not in the replies key.
-* @property {string} [replyURL] A URL that the user can visit to reply to this post
-*/
-
-/**
-* @typedef {Object} PartialPage
-* @description Defines a partial page object in DTPS (for pages list)
-* @property {string} title Page title
-* @property {string} id Page ID
-*/
-
-/**
-* @typedef {Object} Page
-* @description Defines Page objects in DTPS
-* @property {string} title Page title
-* @property {string} id Page ID
-* @property {string} content Page content HTML
-* @property {Date} [updatedAt] When the page was last updated
-* @property {User} [author] Page author
+/**
+ * @file DTPS pages & discussion functions
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+
+/**
+ * Renders the discussions list for a class
+ *
+ * @param {string} courseID The course ID to render discussion threads for
+ * @param {string} [defaultThread] The thread to load by default
+ * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
+ * @param {string} [defaultPost] The post to load by default
+ */
+dtps.loadThreadsList = function (courseID, defaultThread, fromModules, defaultPost) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
+ dtps.selectedClass = classNum;
+
+ //Set discussions as the selected content
+ if (!fromModules) {
+ dtps.selectedContent = "discuss";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.discuss").addClass("active");
+ jQuery("body").removeClass("collapsedSidebar");
+ }
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadThreadsList");
+ }
+
+ //Load class color and things
+ dtps.presentClass(classNum);
+
+ //Load module thread
+ if (fromModules) {
+ dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
+ return;
+ }
+
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
+ //Render sidebar
+ jQuery(".sidebar").html(/*html*/`
+ <div class="title">
+ <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="fluid-icon">forum</i>
+ <h4>Discussions</h4>
+ </div>
+
+ <div class="items">
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Discussion thread Title</span>
+ </div>
+ </div>
+ `);
+
+ //Delete existing class content HTML
+ jQuery(".classContent").html("");
+ }
+
+ //Fetch discussion thread data
+ dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].lmsID).then(function (threadData) {
+ //Store fetched data to the selected class
+ dtps.classes[classNum].discussions = threadData;
+
+ if (dtps.classes[classNum].discussions.length == 0) {
+ //No discussion topics in this class
+ jQuery(".sidebar .items").html(/*html*/`
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No discussions found</p>
+ <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any discussions</p>
+ `);
+ } else {
+ //Loop over discusson threads array to create discussion thread HTML for the sidebar
+ var discussionHTML = dtps.classes[classNum].discussions.map(discussionThread => {
+ return /*html*/`
+ <div data-threadID="${discussionThread.id}" class="item">
+ <i class="fluid-icon">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}</i>
+ <span class="label">${discussionThread.title}</span>
+ </div>
+ `;
+ }).join("");
+
+ //Render discussion threads in the sidebar
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
+ jQuery(".sidebar .items").html(/*html*/`
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ ${
+ dtps.classes[classNum].newDiscussionThreadURL ? (/*html*/`
+ <div onclick="window.open('${dtps.classes[classNum].newDiscussionThreadURL}')" class="item back">
+ <i class="fluid-icon">add</i>
+ <span class="label">New discussion</span>
+ </div>
+ `) : ""
+ }
+
+ <div class="divider"></div>
+
+ ${discussionHTML}
+ `);
+
+ //Load default thread if provided
+ if (defaultThread) {
+ dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
+ }
+
+ //Add click event listeners for discussion threads
+ $(".sidebar .item:not(.back)").click(function (event) {
+ //Show the selected thread as active
+ $(this).siblings().removeClass("active");
+ $(this).addClass("active");
+
+ //Get thread ID from HTML attribute
+ var postID = $(this).attr("data-threadID");
+
+ //Load the thread
+ dtps.loadThreadPosts(classNum, postID);
+ });
+ }
+ }
+
+ }).catch(function (err) {
+ dtps.error("Couldn't fetch discussion threads", "Caught promise rejection @ dtps.loadThreadsList", err);
+ });
+}
+
+/**
+ * Fetches and displays posts in a discussion
+ *
+ * @param {number} classNum The class number to render
+ * @param {string} threadID The discussion thread to render
+ * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
+ * @param {string} [defaultPost] The post ID to jump to
+ */
+dtps.loadThreadPosts = function (classNum, threadID, fromModules, defaultPost) {
+ //Show loading indicator
+ if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
+ jQuery(".classContent").html(/*html*/`
+ <div class="card" style="margin-top: 20px;margin-bottom: 75px;">
+ <h4><span class="shimmer">[SHIMMER] Thread Title</span></h4>
+
+ <div style="margin-bottom: 32px;" class="discussionHeader">
+ <h5 ><span class="shimmer">Discussion author name</span></h5>
+
+ <i class="fluid-icon shimmer">calendar_today</i>
+ <span class="shimmer">Discussion date</span>
+ </div>
+
+ <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 400px; border: none; outline: none;"></div>
+
+ <div style="margin-top: 32px;" class="discussionFooter">
+ <button class="btn small shimmer"><i class="fluid-icon">post_add</i> Add Post</button>
+ </div>
+ </div>
+ `);
+ }
+
+ //Fetch discussion posts from the LMS
+ dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].lmsID, threadID).then(function (thread) {
+ //Post HTML array
+ var postHTML = [];
+
+ thread.posts.forEach((post, index) => {
+ //Get background and text color for iFrame content
+ var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
+ var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
+
+ //Create a new blob data URL with the post's content
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
+ ${post.body}
+ `], { type: 'text/html' });
+ var discussionPostContentURL = window.URL.createObjectURL(blob);
+
+ //Create HTML for replies
+ var replyHTML = [];
+ if (post.replies) {
+ //Add space above replies
+ replyHTML.push(`<br />`);
+
+ //Get HTML for each reply and add to array
+ post.replies.forEach(reply => {
+ replyHTML.push(/*html*/`
+ <div data-post-id="${reply.id}" style="margin-left: ${(reply.depth || 0) * 50}px;" class="discussionReply">
+ <div class="discussionHeader">
+ ${post.author ? /*html*/`
+ <img src="${reply.author.photoURL}" />
+ <h5>${reply.author.name}</h5>
+ ` : ``}
+
+ <span style="cursor: pointer;" onclick="window.open('${reply.replyURL}')">
+ <i class="fluid-icon">reply</i>
+ <span>Reply</span>
+ </span>
+ </div>
+
+ ${reply.body}
+ </div>
+ `)
+ });
+
+ //Add space below replies
+ replyHTML.push(`<br />`);
+ }
+
+ //Create HTML for this post
+ //Note that index == 0 is the initial post
+ postHTML.push(/*html*/`
+ <div class="card" data-post-id="${post.id}" style="margin-top: 20px;${index == 0 ? "margin-bottom: 75px;" : "padding: 20px 30px;"}">
+ <!-- Thread title (Initial post) -->
+ ${index == 0 ? /*html*/`
+ <h4 style="font-weight: bold">${thread.title}</h4>
+ ` : ''}
+
+ <!-- Author header -->
+ <div ${index == 0 ? `style="margin-bottom: 32px;"` : ""} class="discussionHeader">
+ ${post.author ? /*html*/`
+ <img src="${post.author.photoURL}" />
+ <h5>${post.author.name}</h5>
+ ` : ``}
+
+ <i class="fluid-icon">calendar_today</i>
+ <span>${dtps.formatDate(post.postedAt)}</span>
+
+ <!-- Thread info (initial post) -->
+ ${index == 0 ? /*html*/`
+ ${thread.locked ? `<i class="fluid-icon">lock</i>` : ""}
+ ${thread.requireInitialPost ? /*html*/`
+ <i class="fluid-icon">visibility</i>
+ <span>You must post before you can see other replies</span>
+ ` : ""}
+ ` : ''}
+ </div>
+
+ ${index == 0 ? /*html*/`
+ <iframe id="classThreadIframe" onload="dtps.iframeLoad('classThreadIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${discussionPostContentURL}" />
+ ` : post.body}
+
+ ${replyHTML.join("")}
+
+ <!-- Reply / Add post footer -->
+ ${post.replyURL ? /*html*/`
+ <div ${index == 0 ? `style="margin-top: 32px;"` : ""} class="discussionFooter">
+ ${index == 0 ? /*html*/`
+ <button onclick="window.open('${post.replyURL}')" class="btn small"><i class="fluid-icon">post_add</i> Add Post</button>
+ ` : /*html*/`
+ <button onclick="window.open('${post.replyURL}')" class="btn small"><i class="fluid-icon">reply</i> Reply</button>
+ `}
+ </div>
+ ` : ""}
+ </div>
+ `);
+ });
+
+ //Render HTML
+ if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
+ jQuery(".classContent").html((fromModules ? /*html*/`
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="fluid-icon">keyboard_arrow_left</i> Back
+ </button>
+ ` : "") + postHTML.join(""));
+
+ //Jump to post if specified
+ if (defaultPost) {
+ $("[data-post-id=" + defaultPost + "]").get(0).scrollIntoView();
+ }
+ }
+ }).catch(function (err) {
+ dtps.error("Could not fetch discussion posts", "Caught promise rejection @ dtps.loadThreadPosts", err);
+ });
+}
+
+/**
+ * Renders the pages list for a class
+ *
+ * @param {string} courseID The course ID to render pages for
+ * @param {string} [defaultPage] If provided, load the pageID by default
+ * @param {boolean} fromModules True if this page is being loaded from the moduleStream
+ */
+dtps.loadPagesList = function (courseID, defaultPage, fromModules) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
+ dtps.selectedClass = classNum;
+
+ //Set pages as the selected content
+ if (!fromModules) {
+ dtps.selectedContent = "pages";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.pages").addClass("active");
+ jQuery("body").removeClass("collapsedSidebar");
+ }
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadPagesList");
+ }
+
+ //Load class color and things
+ dtps.presentClass(classNum);
+
+ //Load module page
+ if (fromModules) {
+ dtps.loadPage(classNum, defaultPage, fromModules);
+ return;
+ }
+
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
+ //Render sidebar
+ jQuery(".sidebar").html(/*html*/`
+ <div class="title">
+ <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="fluid-icon">insert_drive_file</i>
+ <h4>Pages</h4>
+ </div>
+
+ <div class="items">
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Class page title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Class page title</span>
+ </div>
+ <div class="item shimmerParent">
+ <i class="fluid-icon">star</i>
+ <span class="label">Class page title</span>
+ </div>
+ </div>
+ `);
+
+ //Delete existing class content HTML
+ jQuery(".classContent").html("");
+ }
+
+ dtpsLMS.fetchPages(dtps.classes[classNum].lmsID).then(function (pagesData) {
+ //Store fetched pages data to the class
+ dtps.classes[classNum].pages = pagesData;
+
+ if (pagesData.length == 0) {
+ //No pages in this class
+ jQuery(".sidebar .items").html(/*html*/`
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i>
+ <span class="label">Classes</span>
+ </div>
+
+ <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No pages found</p>
+ <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any pages</p>
+ `);
+ } else {
+ //Loop over discusson threads array to create discussion thread HTML for the sidebar
+ var pageHTML = dtps.classes[classNum].pages.map(page => {
+ return /*html*/`
+ <div data-pageID="${page.id}" class="item ${(defaultPage && (page.id == defaultPage)) ? "active" : ""}">
+ <i class="fluid-icon">insert_drive_file</i>
+ <span class="label">${page.title}</span>
+ </div>
+ `;
+ }).join("");
+
+ //Render discussion threads in the sidebar
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
+ jQuery(".sidebar .items").html(/*html*/`
+ <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
+ <i class="fluid-icon">keyboard_arrow_left</i>
+ <span class="label">Classes</span>
+ </div>
+
+ <div class="divider"></div>
+
+ ${pageHTML}
+ `);
+ }
+
+ //Load default page if provided
+ if (defaultPage) {
+ dtps.loadPage(classNum, defaultPage);
+ }
+
+ //Add click event listeners for pages
+ $(".sidebar .item:not(.back)").click(function (event) {
+ //Show the selected thread as active
+ $(this).siblings().removeClass("active");
+ $(this).addClass("active");
+
+ //Get page ID from HTML attribute
+ var pageID = $(this).attr("data-pageID");
+
+ //Load the page content
+ dtps.loadPage(classNum, pageID);
+ });
+ }
+ }).catch((err) => {
+ dtps.error("Couldn't fetch pages", "Caught promise rejection @ dtps.loadPagesList", err);
+ });
+}
+
+/**
+ * Fetches and renders a page and its contents
+ *
+ * @param {string} classNum The class number of the page to render
+ * @param {string} pageID The page ID to render
+ * @param {boolean} fromModules True if this page is being loaded from the moduleStream
+ */
+dtps.loadPage = function (classNum, pageID, fromModules) {
+ //Show loading indicator
+ if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
+ jQuery(".classContent").html(/*html*/`
+ <div style="margin: 20px; padding: 20px;">
+ <h4><span class="shimmer">[SHIMMER] Class page title</span></h4>
+
+ <div style="margin-bottom: 32px;" class="discussionHeader">
+ <h5 class="shimmer">Page author name</h5>
+
+ <i class="fluid-icon shimmer">calendar_today</i>
+ <span class="shimmer">[SHIMMER] Last updated at</span>
+ </div>
+
+ <!-- Page content -->
+ <br />
+ <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 600px; border: none; outline: none;"></div>
+ </div>
+ `);
+ }
+
+ //Fetch page content
+ dtpsLMS.fetchPageContent(dtps.classes[classNum].lmsID, pageID).then(function (page) {
+ if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
+ //Get computed background and text color to style the iFrame with
+ var computedBackgroundColor = getComputedStyle($(".classContent")[0]).getPropertyValue("--background");
+ var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
+
+ //Generate a blob with the page content and get its data URL
+ var blob = new Blob([`
+ <base target="_blank" />
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
+ <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
+ ${page.content}
+ `], { type: 'text/html' });
+
+ //Get URL from blob
+ var pageContentURL = window.URL.createObjectURL(blob);
+
+ //Render page card in the class content
+ jQuery(".classContent").html(/*html*/`
+ ${fromModules ? /*html*/`
+ <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
+ <i class="fluid-icon">keyboard_arrow_left</i> Back
+ </button>
+ ` : ""}
+ <div style="margin: 20px; padding: 20px;">
+ <!-- Page title -->
+ <h4 style="font-weight: bold;">${page.title}</h4>
+
+ <!-- Page header -->
+ <div style="margin-bottom: 32px;" class="discussionHeader">
+ ${page.author ? /*html*/`
+ <img src="${page.author.photoURL}" />
+ <h5>${page.author.name}</h5>
+ ` : ``}
+
+ <i class="fluid-icon">calendar_today</i>
+ <span>${"Last Updated " + dtps.formatDate(page.updatedAt)}</span>
+ </div>
+
+ <!-- Page content -->
+ <br />
+ <iframe id="classPageIframe" onload="dtps.iframeLoad('classPageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${pageContentURL}" />
+ </div>
+ `);
+ }
+ }).catch((err) => {
+ dtps.error("Couldn't load page", "Caught promise rejection @ dtps.loadPage", err);
+ });
+}
+
+//Fluid UI screen definitions
+fluid.externalScreens.discussions = (param) => {
+ //Split parameter string into variables
+ var courseID = param.split("|")[0];
+ var threadID = param.split("|")[1];
+ var fromModules = param.split("|")[2] == "true";
+ var postID = param.split("|")[3];
+
+ dtps.loadThreadsList(courseID, threadID, fromModules, postID);
+}
+
+fluid.externalScreens.pages = (param) => {
+ //Split parameter string into variables
+ var courseID = param.split("|")[0];
+ var pageID = param.split("|")[1];
+ var fromModules = param.split("|")[2] == "true";
+
+ dtps.loadPagesList(courseID, pageID, fromModules);
+}
+
+//Type definitions
+
+/**
+* @typedef {Object} PartialDiscussionThread
+* @description Defines partial discussion thread objects in DTPS (for threads list)
+* @property {string} title Title of the discussion thread
+* @property {string} id Discussion thread ID
+* @property {boolean} [locked] True if posting to the discussion thread is locked
+*/
+
+/**
+* @typedef {Object} DiscussionThread
+* @description Defines discussion thread objects in DTPS
+* @property {string} title Title of the discussion thread
+* @property {string} id Discussion thread ID
+* @property {DiscussionPost[]} posts Posts in this thread, with the initial one first.
+* @property {boolean} [locked] True if posting to the discussion thread is locked
+* @property {boolean} [requireInitialPost] True if the user must post before viewing others' posts
+*/
+
+/**
+* @typedef {Object} DiscussionPost
+* @description Defines discussion post objects in DTPS
+* @property {string} id Discussion post ID
+* @property {string} body Discussion post body HTML
+* @property {Date} postedAt Date for when the post was posted
+* @property {number} [depth] The depth level this post is
+* @property {User} [author] Discussion post author
+* @property {DiscussionPost[]} [replies] Replies to this post. Nested replies (replies to replies) should be after this post in the array with a depth of 1, not in the replies key.
+* @property {string} [replyURL] A URL that the user can visit to reply to this post
+*/
+
+/**
+* @typedef {Object} PartialPage
+* @description Defines a partial page object in DTPS (for pages list)
+* @property {string} title Page title
+* @property {string} id Page ID
+*/
+
+/**
+* @typedef {Object} Page
+* @description Defines Page objects in DTPS
+* @property {string} title Page title
+* @property {string} id Page ID
+* @property {string} content Page content HTML
+* @property {Date} [updatedAt] When the page was last updated
+* @property {User} [author] Page author
*/
\ No newline at end of file
diff --git a/scripts/people.js b/scripts/people.js
index 9207289..5139023 100644
--- a/scripts/people.js
+++ b/scripts/people.js
@@ -1,156 +1,156 @@
-/**
- * @file DTPS course user list screen
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-
-/**
- * Renders the people tab for a class
- *
- * @param {string} courseID The course ID to render the people tab for
- */
-dtps.usersList = function (courseID) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
- dtps.selectedClass = classNum;
-
- //Set people as the selected content
- dtps.selectedContent = "people";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.people").addClass("active");
-
- //Load class color and things
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.usersList");
- }
-
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
- jQuery(".classContent").html(/*html*/`
- <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
- <div class="block status card">
- <h2 class="main"><span class="shimmer">--</span></h2>
- <h5 class="bottom"><i class="material-icons">contact_page</i> Your section</h5>
- </div>
- <div class="block status">
- <h2 class="main numFont"><span class="shimmer">--</span></h2>
- <h5 class="bottom"><i class="material-icons">groups</i> Total Students</h5>
- </div>
- <div class="block status">
- <h2 class="main numFont"><span class="shimmer">--</span></h2>
- <h5 class="bottom"><i class="material-icons">school</i> Teachers</h5>
- </div>
- </div>
- <div class="card">
- <h5><b style="width: 300px; display: inline-block;" class="shimmer">Title</b></h5>
- ${[1, 2, 3, 4, 5, 6].map(() => (
- /*html*/`
- <div>
- <p class="shimmerParent">
- <span style="width: 30px; height: 30px; outline: none; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 5px;"></span>
- <a style="color: var(--text); vertical-align: middle;">User name</a>
- </p>
- </div>
- `
- )).join("")}
- </div>
- `);
- }
-
- //Fetch users list
- new Promise(resolve => {
- if (dtps.classes[classNum].people && (dtps.classes[classNum].people !== true)) {
- resolve(dtps.classes[classNum].people);
- } else {
- dtpsLMS.fetchUsers(dtps.classes[classNum].lmsID).then(data => resolve(data));
- }
- }).then(function (sections) {
- dtps.classes[classNum].people = sections;
-
- //Count students and teachers by user ID
- var allStudents = [];
- var allTeachers = [];
- var currentSection = null;
- sections.forEach(section => {
- section.users.forEach(user => {
- if ((section.title == "Teachers") && !allTeachers.includes(user.id)) {
- allTeachers.push(user.id);
- } else if (!allStudents.includes(user.id)) {
- allStudents.push(user.id);
- }
-
- if (!currentSection && (user.id == dtps.user.id)) {
- currentSection = section.title;
- }
- });
- });
-
- if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
- if (!sections || (sections.length == 0)) {
- //No people in this class? (this shouldn't be possible)
- jQuery(".classContent").html(/*html*/`
- <div style="cursor: auto;" class="card assignment">
- <h4>Error</h4>
- <p>Power+ could not get the list of people in this course</p>
- </div>
- `);
- } else {
- jQuery(".classContent").html(/*html*/`
- <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
- <div class="block status card">
- <h2 style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="main">${currentSection || "--"}</h2>
- <h5 class="bottom"><i class="material-icons">contact_page</i> Your section</h5>
- </div>
- <div class="block status">
- <h2 class="main numFont">${allStudents.length}</h2>
- <h5 class="bottom"><i class="material-icons">groups</i> Total Students</h5>
- </div>
- <div class="block status">
- <h2 class="main numFont">${allTeachers.length}</h2>
- <h5 class="bottom"><i class="material-icons">school</i> ${allTeachers.length == 1 ? "Teacher" : "Teachers"}</h5>
- </div>
- </div>
- ` + sections.map(section => (
- /*html*/`
- <div class="card">
- <h5><b>${section.title}</b></h5>
- ${section.users.map(user => (
- /*html*/`
- <div>
- <p>
- <img style="width: 30px; border-radius: 50%; vertical-align: middle; margin-right: 5px;" src="${user.photoURL}" />
- <a href="${user.url}" style="color: var(--text); vertical-align: middle;">${user.name}</a>
- </p>
- </div>
- `
- )).join("")}
- </div>
- `
- )).join(""));
- }
- }
- }).catch(function (err) {
- dtps.error("Couldn't fetch users", "Caught promise rejection @ dtps.usersList", err);
- });
-}
-
-//Fluid UI screen definitions
-fluid.externalScreens.people = (courseID) => {
- dtps.usersList(courseID);
-}
-
-/**
-* @typedef {Object} ClassSection
-* @description Defines a class section in DTPS
-* @property {string} title Name of the section
-* @property {string} id Section ID
-* @property {User[]} users Students in this section
+/**
+ * @file DTPS course user list screen
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+
+/**
+ * Renders the people tab for a class
+ *
+ * @param {string} courseID The course ID to render the people tab for
+ */
+dtps.usersList = function (courseID) {
+ //Get class index and set as selected class
+ var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
+ dtps.selectedClass = classNum;
+
+ //Set people as the selected content
+ dtps.selectedContent = "people";
+ $("#dtpsTabBar .btn").removeClass("active");
+ $("#dtpsTabBar .btn.people").addClass("active");
+
+ //Load class color and things
+ dtps.presentClass(classNum);
+
+ //Ensure classes are shown in the sidebar
+ dtps.showClasses();
+
+ if (classNum == -1) {
+ //Class does not exist
+ dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.usersList");
+ }
+
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
+ jQuery(".classContent").html(/*html*/`
+ <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
+ <div class="block status card">
+ <h2 class="main"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="fluid-icon">contact_page</i> Your section</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="fluid-icon">groups</i> Total Students</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont"><span class="shimmer">--</span></h2>
+ <h5 class="bottom"><i class="fluid-icon">school</i> Teachers</h5>
+ </div>
+ </div>
+ <div class="card">
+ <h5><b style="width: 300px; display: inline-block;" class="shimmer">Title</b></h5>
+ ${[1, 2, 3, 4, 5, 6].map(() => (
+ /*html*/`
+ <div>
+ <p class="shimmerParent">
+ <span style="width: 30px; height: 30px; outline: none; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 5px;"></span>
+ <a style="color: var(--text); vertical-align: middle;">User name</a>
+ </p>
+ </div>
+ `
+ )).join("")}
+ </div>
+ `);
+ }
+
+ //Fetch users list
+ new Promise(resolve => {
+ if (dtps.classes[classNum].people && (dtps.classes[classNum].people !== true)) {
+ resolve(dtps.classes[classNum].people);
+ } else {
+ dtpsLMS.fetchUsers(dtps.classes[classNum].lmsID).then(data => resolve(data));
+ }
+ }).then(function (sections) {
+ dtps.classes[classNum].people = sections;
+
+ //Count students and teachers by user ID
+ var allStudents = [];
+ var allTeachers = [];
+ var currentSection = null;
+ sections.forEach(section => {
+ section.users.forEach(user => {
+ if ((section.title == "Teachers") && !allTeachers.includes(user.id)) {
+ allTeachers.push(user.id);
+ } else if (!allStudents.includes(user.id)) {
+ allStudents.push(user.id);
+ }
+
+ if (!currentSection && (user.id == dtps.user.id)) {
+ currentSection = section.title;
+ }
+ });
+ });
+
+ if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "people")) {
+ if (!sections || (sections.length == 0)) {
+ //No people in this class? (this shouldn't be possible)
+ jQuery(".classContent").html(/*html*/`
+ <div style="cursor: auto;" class="card assignment">
+ <h4>Error</h4>
+ <p>Power+ could not get the list of people in this course</p>
+ </div>
+ `);
+ } else {
+ jQuery(".classContent").html(/*html*/`
+ <div style="--size: 250px; margin: 0px 20px;" class="grid flex">
+ <div class="block status card">
+ <h2 style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="main">${currentSection || "--"}</h2>
+ <h5 class="bottom"><i class="fluid-icon">contact_page</i> Your section</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont">${allStudents.length}</h2>
+ <h5 class="bottom"><i class="fluid-icon">groups</i> Total Students</h5>
+ </div>
+ <div class="block status">
+ <h2 class="main numFont">${allTeachers.length}</h2>
+ <h5 class="bottom"><i class="fluid-icon">school</i> ${allTeachers.length == 1 ? "Teacher" : "Teachers"}</h5>
+ </div>
+ </div>
+ ` + sections.map(section => (
+ /*html*/`
+ <div class="card">
+ <h5><b>${section.title}</b></h5>
+ ${section.users.map(user => (
+ /*html*/`
+ <div>
+ <p>
+ <img style="width: 30px; border-radius: 50%; vertical-align: middle; margin-right: 5px;" src="${user.photoURL}" />
+ <a href="${user.url}" style="color: var(--text); vertical-align: middle;">${user.name}</a>
+ </p>
+ </div>
+ `
+ )).join("")}
+ </div>
+ `
+ )).join(""));
+ }
+ }
+ }).catch(function (err) {
+ dtps.error("Couldn't fetch users", "Caught promise rejection @ dtps.usersList", err);
+ });
+}
+
+//Fluid UI screen definitions
+fluid.externalScreens.people = (courseID) => {
+ dtps.usersList(courseID);
+}
+
+/**
+* @typedef {Object} ClassSection
+* @description Defines a class section in DTPS
+* @property {string} title Name of the section
+* @property {string} id Section ID
+* @property {User[]} users Students in this section
*/
\ No newline at end of file
diff --git a/scripts/search.js b/scripts/search.js
index b269a4a..7a0e8f2 100644
--- a/scripts/search.js
+++ b/scripts/search.js
@@ -1,576 +1,576 @@
-/**
- * @file DTPS global search
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-
-/**
- * Searches Power+ globally and shows results on the "Search Results" screen
- *
- * @param term {string} The search term typed in the input box
- */
-dtps.globalSearch = function (term) {
- //Validate search and get search vars
- var type = $("#dtpsMainSearchBox").attr("data-search-type");
- var courseNum = $("#dtpsMainSearchBox").attr("data-dtps-course");
- var term = term ? decodeURI(term) : "";
- if (!type || !courseNum) {
- return fluid.screen("dashboard");
- }
-
- //Ensure classes are rendered in the sidebar
- dtps.presentClass("search");
- dtps.showClasses();
- dtps.selectedContent = "stream";
-
- //Clear active state from all tabs
- $("#dtpsTabBar .btn").removeClass("active");
-
- jQuery(".classContent").html([1, 2, 3, 4].map(() => (
- /*html*/`
- <div class="card assignment graded">
- <h4>
- <span style="width: 450px;" class="shimmer">Assignment Title</span>
- <div class="points shimmer">00/00</div>
- </h4>
-
- <h5 style="white-space: nowrap; overflow: hidden;">
- <div style="width: 200px;" class="infoChip shimmer"></div>
- <i class="material-icons statusIcon shimmer">more_horiz</i>
- </h5>
- </div>
- `
- )).join(""));
-
- //Fetch everything
- var dataset = [];
- var datasetPromises = [];
-
- (courseNum == "all" ? dtps.classes : [dtps.classes[Number(courseNum)]]).forEach(course => {
- if ((type == "assignments") || (type == "coursework") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.assignments) return resolve([]);
- resolve(course.assignments.map(assignment => ({
- title: assignment.title,
- class: course.num,
- body: $('<div>' + assignment.body + '</div>').text(),
- onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
- locatedIn: assignment.category ? assignment.category : "Assignment",
- icon: "assignment",
- type: "assignment",
- infoIcons: [
- assignment.dueAt ? "alarm" : null
- ].filter(i => i),
- info: [
- assignment.dueAt ? "Due: " + dtps.formatDate(assignment.dueAt) : null
- ].filter(i => i).join("$|$"),
- icons: [
- {
- icon: assignment.missing ? "remove_circle_outline" : null,
- state: "missing"
- },
- {
- icon: assignment.turnedIn ? "assignment_turned_in" : null,
- state: "turnedIn"
- },
- {
- icon: assignment.locked ? "lock_outline" : null,
- state: "locked"
- },
- {
- icon: assignment.late ? "assignment_late" : null,
- state: "late"
- }
- ].filter(i => i.icon)
- })));
- }));
- }
-
- if ((type == "modules") || (type == "coursework") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.modules) return resolve([]);
- new Promise(resolve => {
- if (course.modules && (course.modules !== true)) {
- resolve(course.modules);
- } else {
- dtpsLMS.fetchModules(dtps.user.id, course.lmsID).then(data => resolve(data));
- }
- }).then(data => {
- var res = [];
- data.forEach(module => {
- module.items.forEach(item => {
- //Prevent assignments from showing twice in coursework search results
- //(since assignments can appear in both assignments and modules tab)
- if ((item.type == "assignment") && (type == "coursework")) return;
-
- item.locatedIn = module.title;
- res.push(item);
- });
- });
-
- resolve(res.map(item => ({
- title: item.title,
- class: course.num,
- url: item.url,
- locatedIn: item.locatedIn,
- icon: "view_module",
- infoIcons: [
- "category"
- ].filter(i => i),
- info: [
- "Type: " + item.type
- ].filter(i => i).join("$|$"),
- icons: [
- {
- icon: item.completed ? "check" : null,
- keywords: "completed done submitted"
- }
- ].filter(i => i.icon)
- })));
- }).catch(() => resolve([]));
- }));
- }
-
- if ((type == "homepages") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.homepage) return resolve([]);
- dtpsLMS.fetchHomepage(course.lmsID).then(data => {
- resolve([{
- title: course.subject + " Homepage",
- class: course.num,
- onclick: "dtps.classHome(" + course.num + ");",
- locatedIn: course.subject,
- icon: "home",
- body: $('<div>' + data + '</div>').text(),
- icons: []
- }]);
- }).catch(() => resolve([]));
- }));
- }
-
- if ((type == "pages") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.pages) return resolve([]);
- dtpsLMS.fetchPages(course.lmsID).then(pages => {
- Promise.all(pages.map(page => (
- dtpsLMS.fetchPageContent(course.lmsID, page.id)
- ))).then(pages => {
- resolve(pages.map(page => ({
- title: page.title,
- class: course.num,
- onclick: "fluid.screen('pages', '" + course.id + "|" + page.id + "');",
- body: $('<div>' + page.content + '</div>').text(),
- locatedIn: "Page",
- icon: "insert_drive_file",
- infoIcons: [
- page.author && page.author.name ? "person" : null
- ].filter(i => i),
- info: [
- page.author && page.author.name ? "Author: " + page.author && page.author.name : null
- ].filter(i => i).join("$|$"),
- icons: []
- })));
- })
- }).catch(() => resolve([]));
- }));
- }
-
- if ((type == "discussions") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.discussions) return resolve([]);
- dtpsLMS.fetchDiscussionThreads(course.lmsID).then(discussions => {
- Promise.all(discussions.map(discussion => (
- dtpsLMS.fetchDiscussionPosts(course.lmsID, discussion.id)
- ))).then(discussions => {
- var res = [];
- discussions.forEach(discussion => {
- discussion.posts.forEach(post => {
- post.locatedIn = discussion.title;
- post.threadID = discussion.id;
- res.push(post);
-
- if (post.replies) {
- post.replies.forEach(reply => {
- reply.locatedIn = discussion.title;
- reply.threadID = discussion.id;
- res.push(reply);
- });
- }
- })
- });
- resolve(res.map(post => ({
- body: $('<div>' + post.body + '</div>').text(),
- class: course.num,
- onclick: "fluid.screen('discussions', '" + course.id + "|" + post.threadID + "|false|" + post.id + "');",
- locatedIn: post.locatedIn,
- icon: "forum",
- infoIcons: [
- post.author && post.author.name ? "person" : null,
- post.postedAt ? "calendar_today" : null
- ].filter(i => i),
- info: [
- post.author && post.author.name ? "Author: " + post.author && post.author.name : null,
- post.postedAt ? "Posted At: " + dtps.formatDate(post.postedAt) : null
- ].filter(i => i).join("$|$"),
- icons: []
- })));
- })
- }).catch(() => resolve([]));
- }));
- }
-
- if ((type == "people") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.people) return resolve([]);
- new Promise(resolve => {
- if (course.people && (course.people !== true)) {
- resolve(course.people);
- } else {
- dtpsLMS.fetchUsers(course.lmsID).then(data => resolve(data));
- }
- }).then(data => {
- var res = [];
- data.forEach(section => {
- section.users.forEach(user => {
- user.locatedIn = section.title;
- res.push(user);
- });
- });
- resolve(res.map(person => ({
- title: person.name,
- class: course.num,
- url: person.url,
- locatedIn: person.locatedIn,
- icon: "people",
- icons: []
- })));
- }).catch(() => resolve([]));
- }));
- }
-
- if ((type == "grades") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- if (!course.assignments) return resolve([]);
- var res = [];
-
- course.assignments.forEach(assignment => {
- if (dtpsLMS.useRubricGrades && assignment.rubric) {
- assignment.rubric.forEach(rubric => {
- if (rubric.score) {
- res.push({
- title: assignment.title,
- class: course.num,
- onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
- locatedIn: rubric.title,
- icon: "assessment",
- infoIcons: [
- "bar_chart"
- ].filter(i => i),
- info: [
- "Score: " + rubric.score + "/" + rubric.value + (rubric.scoreName ? " " + rubric.scoreName : "")
- ].filter(i => i).join("$|$"),
- icons: []
- });
- }
- });
- } else if (assignment.grade) {
- res.push({
- title: assignment.title,
- class: course.num,
- onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
- locatedIn: "Grade",
- icon: "assessment",
- infoIcons: [
- "bar_chart"
- ].filter(i => i),
- info: [
- "Score: " + assignment.grade + "/" + assignment.value + " (" + Math.round((assignment.grade / assignment.value) * 100) + "%" + (assignment.letter ? ", " + assignment.letter : "") + ")"
- ].filter(i => i).join("$|$"),
- icons: []
- });
- }
- });
-
- resolve(res);
- }));
- }
-
- if ((type == "announcements") || (type == "everything")) {
- datasetPromises.push(new Promise((resolve, reject) => {
- dtpsLMS.fetchAnnouncements(course.lmsID).then(announcements => {
- resolve(announcements.map((announcement) => ({
- title: announcement.title,
- url: announcement.url,
- class: course.num,
- locatedIn: course.subject,
- icon: "announcement",
- body: $('<div>' + announcement.body + '</div>').text(),
- infoIcons: [
- "calendar_today"
- ].filter(i => i),
- info: [
- "Posted at: " + dtps.formatDate(announcement.postedAt)
- ].filter(i => i).join("$|$"),
- icons: []
- })));
- }).catch(() => resolve([]));
- }));
- }
- });
-
- Promise.all(datasetPromises).then(results => {
- results.forEach(result => {
- dataset = dataset.concat(result);
- });
-
- var idx = lunr(function () {
- this.ref('id');
- this.field('title');
- this.field('body');
- this.field('locatedIn');
- this.field('info');
- this.metadataWhitelist = ['position'];
-
- dataset.forEach(function (doc, i) {
- this.add({
- id: i,
- ...doc
- });
- }, this)
- });
-
- var result = idx.search(term);
- var resHTML = result.map(res => dtps.renderSearchResult(dataset[Number(res.ref)], res.matchData.metadata, courseNum == "all")).join("");
-
- if (dtps.selectedClass == "search") {
- $(".headerArea .contentLabel i").text("find_in_page");
- $(".headerArea .contentLabel span").text(result.length + " results");
- $(".headerArea .contentLabel").show();
-
- $(".classContent").html(/*html*/`
- <div ${!["assignments", "coursework"].includes(type) ? `style="display: none;"` : ``} id="searchFilterContainer">
- <div id="searchFilterCard" class="card">
- <h5><i class="material-icons">filter_alt</i><span>Filters</span></h5>
- <div class="checkContainer">
- <div id="missingSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="material-icons">check</i></div>
- <div class="label"><i class="material-icons">remove_circle_outline</i> Missing</div>
- </div>
- <div class="checkContainer">
- <div id="turnedInSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="material-icons">check</i></div>
- <div class="label"><i class="material-icons">assignment_turned_in</i> Turned in</div>
- </div>
- <div class="checkContainer">
- <div id="lateSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="material-icons">check</i></div>
- <div class="label"><i class="material-icons">assignment_late</i> Late</div>
- </div>
- <div class="checkContainer">
- <div id="lockedSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="material-icons">check</i></div>
- <div class="label"><i class="material-icons">lock_outline</i> Locked</div>
- </div>
- </div>
- </div>
- <div ${["assignments", "coursework"].includes(type) ? `class="withFilters"` : ``} id="searchResultsContainer">
- ${resHTML}
- </div>
- `);
-
- if (!dtps.searchScrollListener) {
- dtps.searchScrollListener = true;
- var searchFilters = document.getElementById("searchFilterCard");
- var sticky = searchFilters.offsetTop - parseFloat($("body").css("padding-top"));
- window.onscroll = function () {
- if ((window.pageYOffset >= sticky) && (dtps.selectedClass == "search")) {
- $(".classContent").addClass("fixedSearchFilters");
- } else {
- $(".classContent").removeClass("fixedSearchFilters");
- }
- };
- }
- }
-
- /**
- * Filters search results
- *
- * @param {Element|string} [toggleItem] The selector for the element to toggle
- */
- dtps.filterSearch = function (toggleItem) {
- if (toggleItem) $(toggleItem).toggleClass("active");
-
- //Check for enabled filters
- var missingFilter = $("#missingSearchFilter").hasClass("active");
- var turnedInFilter = $("#turnedInSearchFilter").hasClass("active");
- var lateFilter = $("#lateSearchFilter").hasClass("active");
- var lockedFilter = $("#lockedSearchFilter").hasClass("active");
-
- var filtersActive = missingFilter || turnedInFilter || lateFilter || lockedFilter;
-
- var filterRes = result.filter(function (res) {
- var item = dataset[Number(res.ref)];
-
- if (!filtersActive) return true;
-
- if (item.type == "assignment") {
- if (missingFilter && item.icons.map(i => i.state).includes("missing")) return true;
- if (turnedInFilter && item.icons.map(i => i.state).includes("turnedIn")) return true;
- if (lateFilter && item.icons.map(i => i.state).includes("late")) return true;
- if (lockedFilter && item.icons.map(i => i.state).includes("locked")) return true;
- }
-
- return false;
- });
-
- var filterHTML = filterRes.map(res => dtps.renderSearchResult(dataset[Number(res.ref)], res.matchData.metadata, courseNum == "all")).join("");
-
- if (dtps.selectedClass == "search") {
- $(".headerArea .contentLabel i").text(filtersActive ? "filter_alt" : "find_in_page");
- $(".headerArea .contentLabel span").text(filterRes.length + " results");
- $(".headerArea .contentLabel").show();
-
- $("#searchResultsContainer").html(filterHTML);
- }
- }
- });
-}
-
-/**
- * Renders a Search data object into HTML for display in the search results list
- *
- * @param {SearchData} result The search result to render
- * @param {Object[]} matchData The list of matches from Lunr
- * @param {boolean} [mixedClasses] True if there are results from multiple classes
- * @return {string} The HTML for this result in the results list
- */
-dtps.renderSearchResult = function (result, matchData, mixedClasses) {
-
- if (!result.processed) {
- var matches = {};
- var matchTerms = Object.values(matchData);
- matchTerms.forEach(term => {
- Object.keys(term).forEach(k => {
- if (matches[k]) {
- matches[k] = matches[k].concat(term[k].position);
- } else {
- matches[k] = term[k].position;
- }
- });
- });
- matches = Object.keys(matches).map(k => ({ key: k, position: matches[k] }));
-
- //A function that highlights a string
- function highlightString(string, position) {
- var parts = string.split("");
- position.forEach(pos => {
- //highlight part
- parts.forEach((part, i) => {
- if (i == pos[0]) {
- parts[i] = '<span class="highlight">' + parts[i];
- }
-
- if (i == (pos[0] + pos[1] - 1)) {
- parts[i] = parts[i] + '</span>';
- }
- });
- });
-
- return parts.join("");
- }
-
- //Highlight matches
- result.bodyParts = [];
- result.bodyOverflow = 0;
- matches.forEach(match => {
- if (match.key == "title") {
- result.title = highlightString(result.title, match.position);
- } else if (match.key == "locatedIn") {
- result.locatedIn = highlightString(result.locatedIn, match.position);
- } else if (match.key == "body") {
- //Get longest 2 matches
- var sections = match.position.sort((a, b) => b[1] - a[1]);
- var matchesToDisplay = 2;
- if (sections.length < matchesToDisplay) matchesToDisplay = sections.length;
- result.bodyOverflow = sections.length - matchesToDisplay;
-
- for (var i = 0; i < matchesToDisplay; i++) {
- var matchStartIndex = sections[i][0];
- var matchEndIndex = sections[i][0] + sections[i][1] - 1;
-
- var startIndex = matchStartIndex - 10;
- var endIndex = matchEndIndex + 10;
-
- if (startIndex < 0) startIndex = 0;
- if (endIndex > (result.body.length - 1)) endIndex = result.body.length - 1;
-
- var res = result.body.slice(startIndex, matchStartIndex) + '<span class="highlight">' + result.body.slice(matchStartIndex, matchEndIndex + 1) + '</span>' + result.body.slice(matchEndIndex + 1, endIndex + 1);
- result.bodyParts.push(res);
- }
- } else if (match.key == "info") {
- result.info = highlightString(result.info, match.position);
- }
- });
-
- //Map result info back into an array
- if (result.info) {
- result.info = result.info.split("$|$").map((info, i) => {
- return {
- icon: result.infoIcons[i],
- info: info,
- }
- });
- }
-
- //Mark this result as processed so it doesn't have to be re-highlighted if a filter is used
- result.processed = true;
- }
-
- return /*html*/`
- <div
- class="card searchResult ${mixedClasses ? "mixedClasses" : ""}"
- style="${'--classColor: ' + dtps.classes[result.class].color}"
- onclick="${result.onclick || (result.url && "window.open('" + result.url + "')")}"
- >
-
- <!-- Color bar for the dashboard -->
- <div class="colorBar"></div>
-
- <!-- Assignment title and points -->
- ${result.title ? `<h4>${result.title}</h4>` : ""}
-
- <h5>
- <div class="infoChip"><i style="margin-top: -2px;" class="material-icons">${result.icon}</i> ${result.locatedIn}</div>
- ${result.info ? result.info.map(info => (
- `<div class="infoChip"><i style="margin-top: -2px;" class="material-icons">${info.icon}</i> ${info.info}</div>`
- )).join("") : ""}
- </h5>
-
- ${result.bodyParts.map(part => (
- `<p><span style="color: var(--secText);">...</span>${part}<span style="color: var(--secText);">...</span></p>`
- )).join("")}
- ${result.bodyOverflow ? `<p style="color: var(--secText);">+${result.bodyOverflow} more matches</p>` : ""}
-
- <h5>
- ${result.icons.map((icon, i) => (`<i class="material-icons statusIcon">${icon.icon}</i>`)).join("")}
- </h5>
- </div>
- `;
-}
-
-//Fluid UI screen definitions
-fluid.externalScreens.search = (term) => {
- dtps.globalSearch(term);
-}
-
-/**
- * @typedef {Object} SearchData
- * @description An object that can represent any type of data to be searched.
- * @property {string} [title] Result title
- * @property {string} [body] Result body (can be HTML)
- * @property {string} [url] A URL for opening this result in the LMS
- * @property {string} locatedIn Describes where this result was found (as specific as possible)
- * @property {string} icon The icon to use for this result. Should match (and is displayed with) the locatedIn property.
- * @property {Object[]} [info] Contains any info (e.g. due dates) for this result. Has an icon property, label property, and info property.
- * @property {Object[]} icons Status icons for this result. Has an "icon" property, for the icon, and a "keywords" property for a string with all of the search keywords for the icon.
- * @property {number} class The number of the class that this result is from
+/**
+ * @file DTPS global search
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+
+/**
+ * Searches Power+ globally and shows results on the "Search Results" screen
+ *
+ * @param term {string} The search term typed in the input box
+ */
+dtps.globalSearch = function (term) {
+ //Validate search and get search vars
+ var type = $("#dtpsMainSearchBox").attr("data-search-type");
+ var courseNum = $("#dtpsMainSearchBox").attr("data-dtps-course");
+ var term = term ? decodeURI(term) : "";
+ if (!type || !courseNum) {
+ return fluid.screen("dashboard");
+ }
+
+ //Ensure classes are rendered in the sidebar
+ dtps.presentClass("search");
+ dtps.showClasses();
+ dtps.selectedContent = "stream";
+
+ //Clear active state from all tabs
+ $("#dtpsTabBar .btn").removeClass("active");
+
+ jQuery(".classContent").html([1, 2, 3, 4].map(() => (
+ /*html*/`
+ <div class="card assignment graded">
+ <h4>
+ <span style="width: 450px;" class="shimmer">Assignment Title</span>
+ <div class="points shimmer">00/00</div>
+ </h4>
+
+ <h5 style="white-space: nowrap; overflow: hidden;">
+ <div style="width: 200px;" class="infoChip shimmer"></div>
+ <i class="fluid-icon statusIcon shimmer">more_horiz</i>
+ </h5>
+ </div>
+ `
+ )).join(""));
+
+ //Fetch everything
+ var dataset = [];
+ var datasetPromises = [];
+
+ (courseNum == "all" ? dtps.classes : [dtps.classes[Number(courseNum)]]).forEach(course => {
+ if ((type == "assignments") || (type == "coursework") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.assignments) return resolve([]);
+ resolve(course.assignments.map(assignment => ({
+ title: assignment.title,
+ class: course.num,
+ body: $('<div>' + assignment.body + '</div>').text(),
+ onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
+ locatedIn: assignment.category ? assignment.category : "Assignment",
+ icon: "assignment",
+ type: "assignment",
+ infoIcons: [
+ assignment.dueAt ? "alarm" : null
+ ].filter(i => i),
+ info: [
+ assignment.dueAt ? "Due: " + dtps.formatDate(assignment.dueAt) : null
+ ].filter(i => i).join("$|$"),
+ icons: [
+ {
+ icon: assignment.missing ? "remove_circle_outline" : null,
+ state: "missing"
+ },
+ {
+ icon: assignment.turnedIn ? "assignment_turned_in" : null,
+ state: "turnedIn"
+ },
+ {
+ icon: assignment.locked ? "lock_outline" : null,
+ state: "locked"
+ },
+ {
+ icon: assignment.late ? "assignment_late" : null,
+ state: "late"
+ }
+ ].filter(i => i.icon)
+ })));
+ }));
+ }
+
+ if ((type == "modules") || (type == "coursework") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.modules) return resolve([]);
+ new Promise(resolve => {
+ if (course.modules && (course.modules !== true)) {
+ resolve(course.modules);
+ } else {
+ dtpsLMS.fetchModules(dtps.user.id, course.lmsID).then(data => resolve(data));
+ }
+ }).then(data => {
+ var res = [];
+ data.forEach(module => {
+ module.items.forEach(item => {
+ //Prevent assignments from showing twice in coursework search results
+ //(since assignments can appear in both assignments and modules tab)
+ if ((item.type == "assignment") && (type == "coursework")) return;
+
+ item.locatedIn = module.title;
+ res.push(item);
+ });
+ });
+
+ resolve(res.map(item => ({
+ title: item.title,
+ class: course.num,
+ url: item.url,
+ locatedIn: item.locatedIn,
+ icon: "view_module",
+ infoIcons: [
+ "category"
+ ].filter(i => i),
+ info: [
+ "Type: " + item.type
+ ].filter(i => i).join("$|$"),
+ icons: [
+ {
+ icon: item.completed ? "check" : null,
+ keywords: "completed done submitted"
+ }
+ ].filter(i => i.icon)
+ })));
+ }).catch(() => resolve([]));
+ }));
+ }
+
+ if ((type == "homepages") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.homepage) return resolve([]);
+ dtpsLMS.fetchHomepage(course.lmsID).then(data => {
+ resolve([{
+ title: course.subject + " Homepage",
+ class: course.num,
+ onclick: "dtps.classHome(" + course.num + ");",
+ locatedIn: course.subject,
+ icon: "home",
+ body: $('<div>' + data + '</div>').text(),
+ icons: []
+ }]);
+ }).catch(() => resolve([]));
+ }));
+ }
+
+ if ((type == "pages") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.pages) return resolve([]);
+ dtpsLMS.fetchPages(course.lmsID).then(pages => {
+ Promise.all(pages.map(page => (
+ dtpsLMS.fetchPageContent(course.lmsID, page.id)
+ ))).then(pages => {
+ resolve(pages.map(page => ({
+ title: page.title,
+ class: course.num,
+ onclick: "fluid.screen('pages', '" + course.id + "|" + page.id + "');",
+ body: $('<div>' + page.content + '</div>').text(),
+ locatedIn: "Page",
+ icon: "insert_drive_file",
+ infoIcons: [
+ page.author && page.author.name ? "person" : null
+ ].filter(i => i),
+ info: [
+ page.author && page.author.name ? "Author: " + page.author && page.author.name : null
+ ].filter(i => i).join("$|$"),
+ icons: []
+ })));
+ })
+ }).catch(() => resolve([]));
+ }));
+ }
+
+ if ((type == "discussions") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.discussions) return resolve([]);
+ dtpsLMS.fetchDiscussionThreads(course.lmsID).then(discussions => {
+ Promise.all(discussions.map(discussion => (
+ dtpsLMS.fetchDiscussionPosts(course.lmsID, discussion.id)
+ ))).then(discussions => {
+ var res = [];
+ discussions.forEach(discussion => {
+ discussion.posts.forEach(post => {
+ post.locatedIn = discussion.title;
+ post.threadID = discussion.id;
+ res.push(post);
+
+ if (post.replies) {
+ post.replies.forEach(reply => {
+ reply.locatedIn = discussion.title;
+ reply.threadID = discussion.id;
+ res.push(reply);
+ });
+ }
+ })
+ });
+ resolve(res.map(post => ({
+ body: $('<div>' + post.body + '</div>').text(),
+ class: course.num,
+ onclick: "fluid.screen('discussions', '" + course.id + "|" + post.threadID + "|false|" + post.id + "');",
+ locatedIn: post.locatedIn,
+ icon: "forum",
+ infoIcons: [
+ post.author && post.author.name ? "person" : null,
+ post.postedAt ? "calendar_today" : null
+ ].filter(i => i),
+ info: [
+ post.author && post.author.name ? "Author: " + post.author && post.author.name : null,
+ post.postedAt ? "Posted At: " + dtps.formatDate(post.postedAt) : null
+ ].filter(i => i).join("$|$"),
+ icons: []
+ })));
+ })
+ }).catch(() => resolve([]));
+ }));
+ }
+
+ if ((type == "people") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.people) return resolve([]);
+ new Promise(resolve => {
+ if (course.people && (course.people !== true)) {
+ resolve(course.people);
+ } else {
+ dtpsLMS.fetchUsers(course.lmsID).then(data => resolve(data));
+ }
+ }).then(data => {
+ var res = [];
+ data.forEach(section => {
+ section.users.forEach(user => {
+ user.locatedIn = section.title;
+ res.push(user);
+ });
+ });
+ resolve(res.map(person => ({
+ title: person.name,
+ class: course.num,
+ url: person.url,
+ locatedIn: person.locatedIn,
+ icon: "people",
+ icons: []
+ })));
+ }).catch(() => resolve([]));
+ }));
+ }
+
+ if ((type == "grades") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ if (!course.assignments) return resolve([]);
+ var res = [];
+
+ course.assignments.forEach(assignment => {
+ if (dtpsLMS.useRubricGrades && assignment.rubric) {
+ assignment.rubric.forEach(rubric => {
+ if (rubric.score) {
+ res.push({
+ title: assignment.title,
+ class: course.num,
+ onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
+ locatedIn: rubric.title,
+ icon: "assessment",
+ infoIcons: [
+ "bar_chart"
+ ].filter(i => i),
+ info: [
+ "Score: " + rubric.score + "/" + rubric.value + (rubric.scoreName ? " " + rubric.scoreName : "")
+ ].filter(i => i).join("$|$"),
+ icons: []
+ });
+ }
+ });
+ } else if (assignment.grade) {
+ res.push({
+ title: assignment.title,
+ class: course.num,
+ onclick: "dtps.assignment('" + assignment.id + "', " + assignment.class + ")",
+ locatedIn: "Grade",
+ icon: "assessment",
+ infoIcons: [
+ "bar_chart"
+ ].filter(i => i),
+ info: [
+ "Score: " + assignment.grade + "/" + assignment.value + " (" + Math.round((assignment.grade / assignment.value) * 100) + "%" + (assignment.letter ? ", " + assignment.letter : "") + ")"
+ ].filter(i => i).join("$|$"),
+ icons: []
+ });
+ }
+ });
+
+ resolve(res);
+ }));
+ }
+
+ if ((type == "announcements") || (type == "everything")) {
+ datasetPromises.push(new Promise((resolve, reject) => {
+ dtpsLMS.fetchAnnouncements(course.lmsID).then(announcements => {
+ resolve(announcements.map((announcement) => ({
+ title: announcement.title,
+ url: announcement.url,
+ class: course.num,
+ locatedIn: course.subject,
+ icon: "announcement",
+ body: $('<div>' + announcement.body + '</div>').text(),
+ infoIcons: [
+ "calendar_today"
+ ].filter(i => i),
+ info: [
+ "Posted at: " + dtps.formatDate(announcement.postedAt)
+ ].filter(i => i).join("$|$"),
+ icons: []
+ })));
+ }).catch(() => resolve([]));
+ }));
+ }
+ });
+
+ Promise.all(datasetPromises).then(results => {
+ results.forEach(result => {
+ dataset = dataset.concat(result);
+ });
+
+ var idx = lunr(function () {
+ this.ref('id');
+ this.field('title');
+ this.field('body');
+ this.field('locatedIn');
+ this.field('info');
+ this.metadataWhitelist = ['position'];
+
+ dataset.forEach(function (doc, i) {
+ this.add({
+ id: i,
+ ...doc
+ });
+ }, this)
+ });
+
+ var result = idx.search(term);
+ var resHTML = result.map(res => dtps.renderSearchResult(dataset[Number(res.ref)], res.matchData.metadata, courseNum == "all")).join("");
+
+ if (dtps.selectedClass == "search") {
+ $(".headerArea .contentLabel i").text("find_in_page");
+ $(".headerArea .contentLabel span").text(result.length + " results");
+ $(".headerArea .contentLabel").show();
+
+ $(".classContent").html(/*html*/`
+ <div ${!["assignments", "coursework"].includes(type) ? `style="display: none;"` : ``} id="searchFilterContainer">
+ <div id="searchFilterCard" class="card">
+ <h5><i class="fluid-icon">filter_alt</i><span>Filters</span></h5>
+ <div class="checkContainer">
+ <div id="missingSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="fluid-icon">check</i></div>
+ <div class="label"><i class="fluid-icon">remove_circle_outline</i> Missing</div>
+ </div>
+ <div class="checkContainer">
+ <div id="turnedInSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="fluid-icon">check</i></div>
+ <div class="label"><i class="fluid-icon">assignment_turned_in</i> Turned in</div>
+ </div>
+ <div class="checkContainer">
+ <div id="lateSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="fluid-icon">check</i></div>
+ <div class="label"><i class="fluid-icon">assignment_late</i> Late</div>
+ </div>
+ <div class="checkContainer">
+ <div id="lockedSearchFilter" init="true" onclick="dtps.filterSearch(this)" class="checkbox"><i class="fluid-icon">check</i></div>
+ <div class="label"><i class="fluid-icon">lock_outline</i> Locked</div>
+ </div>
+ </div>
+ </div>
+ <div ${["assignments", "coursework"].includes(type) ? `class="withFilters"` : ``} id="searchResultsContainer">
+ ${resHTML}
+ </div>
+ `);
+
+ if (!dtps.searchScrollListener) {
+ dtps.searchScrollListener = true;
+ var searchFilters = document.getElementById("searchFilterCard");
+ var sticky = searchFilters.offsetTop - parseFloat($("body").css("padding-top"));
+ window.onscroll = function () {
+ if ((window.pageYOffset >= sticky) && (dtps.selectedClass == "search")) {
+ $(".classContent").addClass("fixedSearchFilters");
+ } else {
+ $(".classContent").removeClass("fixedSearchFilters");
+ }
+ };
+ }
+ }
+
+ /**
+ * Filters search results
+ *
+ * @param {Element|string} [toggleItem] The selector for the element to toggle
+ */
+ dtps.filterSearch = function (toggleItem) {
+ if (toggleItem) $(toggleItem).toggleClass("active");
+
+ //Check for enabled filters
+ var missingFilter = $("#missingSearchFilter").hasClass("active");
+ var turnedInFilter = $("#turnedInSearchFilter").hasClass("active");
+ var lateFilter = $("#lateSearchFilter").hasClass("active");
+ var lockedFilter = $("#lockedSearchFilter").hasClass("active");
+
+ var filtersActive = missingFilter || turnedInFilter || lateFilter || lockedFilter;
+
+ var filterRes = result.filter(function (res) {
+ var item = dataset[Number(res.ref)];
+
+ if (!filtersActive) return true;
+
+ if (item.type == "assignment") {
+ if (missingFilter && item.icons.map(i => i.state).includes("missing")) return true;
+ if (turnedInFilter && item.icons.map(i => i.state).includes("turnedIn")) return true;
+ if (lateFilter && item.icons.map(i => i.state).includes("late")) return true;
+ if (lockedFilter && item.icons.map(i => i.state).includes("locked")) return true;
+ }
+
+ return false;
+ });
+
+ var filterHTML = filterRes.map(res => dtps.renderSearchResult(dataset[Number(res.ref)], res.matchData.metadata, courseNum == "all")).join("");
+
+ if (dtps.selectedClass == "search") {
+ $(".headerArea .contentLabel i").text(filtersActive ? "filter_alt" : "find_in_page");
+ $(".headerArea .contentLabel span").text(filterRes.length + " results");
+ $(".headerArea .contentLabel").show();
+
+ $("#searchResultsContainer").html(filterHTML);
+ }
+ }
+ });
+}
+
+/**
+ * Renders a Search data object into HTML for display in the search results list
+ *
+ * @param {SearchData} result The search result to render
+ * @param {Object[]} matchData The list of matches from Lunr
+ * @param {boolean} [mixedClasses] True if there are results from multiple classes
+ * @return {string} The HTML for this result in the results list
+ */
+dtps.renderSearchResult = function (result, matchData, mixedClasses) {
+
+ if (!result.processed) {
+ var matches = {};
+ var matchTerms = Object.values(matchData);
+ matchTerms.forEach(term => {
+ Object.keys(term).forEach(k => {
+ if (matches[k]) {
+ matches[k] = matches[k].concat(term[k].position);
+ } else {
+ matches[k] = term[k].position;
+ }
+ });
+ });
+ matches = Object.keys(matches).map(k => ({ key: k, position: matches[k] }));
+
+ //A function that highlights a string
+ function highlightString(string, position) {
+ var parts = string.split("");
+ position.forEach(pos => {
+ //highlight part
+ parts.forEach((part, i) => {
+ if (i == pos[0]) {
+ parts[i] = '<span class="highlight">' + parts[i];
+ }
+
+ if (i == (pos[0] + pos[1] - 1)) {
+ parts[i] = parts[i] + '</span>';
+ }
+ });
+ });
+
+ return parts.join("");
+ }
+
+ //Highlight matches
+ result.bodyParts = [];
+ result.bodyOverflow = 0;
+ matches.forEach(match => {
+ if (match.key == "title") {
+ result.title = highlightString(result.title, match.position);
+ } else if (match.key == "locatedIn") {
+ result.locatedIn = highlightString(result.locatedIn, match.position);
+ } else if (match.key == "body") {
+ //Get longest 2 matches
+ var sections = match.position.sort((a, b) => b[1] - a[1]);
+ var matchesToDisplay = 2;
+ if (sections.length < matchesToDisplay) matchesToDisplay = sections.length;
+ result.bodyOverflow = sections.length - matchesToDisplay;
+
+ for (var i = 0; i < matchesToDisplay; i++) {
+ var matchStartIndex = sections[i][0];
+ var matchEndIndex = sections[i][0] + sections[i][1] - 1;
+
+ var startIndex = matchStartIndex - 10;
+ var endIndex = matchEndIndex + 10;
+
+ if (startIndex < 0) startIndex = 0;
+ if (endIndex > (result.body.length - 1)) endIndex = result.body.length - 1;
+
+ var res = result.body.slice(startIndex, matchStartIndex) + '<span class="highlight">' + result.body.slice(matchStartIndex, matchEndIndex + 1) + '</span>' + result.body.slice(matchEndIndex + 1, endIndex + 1);
+ result.bodyParts.push(res);
+ }
+ } else if (match.key == "info") {
+ result.info = highlightString(result.info, match.position);
+ }
+ });
+
+ //Map result info back into an array
+ if (result.info) {
+ result.info = result.info.split("$|$").map((info, i) => {
+ return {
+ icon: result.infoIcons[i],
+ info: info,
+ }
+ });
+ }
+
+ //Mark this result as processed so it doesn't have to be re-highlighted if a filter is used
+ result.processed = true;
+ }
+
+ return /*html*/`
+ <div
+ class="card searchResult ${mixedClasses ? "mixedClasses" : ""}"
+ style="${'--classColor: ' + dtps.classes[result.class].color}"
+ onclick="${result.onclick || (result.url && "window.open('" + result.url + "')")}"
+ >
+
+ <!-- Color bar for the dashboard -->
+ <div class="colorBar"></div>
+
+ <!-- Assignment title and points -->
+ ${result.title ? `<h4>${result.title}</h4>` : ""}
+
+ <h5>
+ <div class="infoChip"><i style="margin-top: -2px;" class="fluid-icon">${result.icon}</i> ${result.locatedIn}</div>
+ ${result.info ? result.info.map(info => (
+ `<div class="infoChip"><i style="margin-top: -2px;" class="fluid-icon">${info.icon}</i> ${info.info}</div>`
+ )).join("") : ""}
+ </h5>
+
+ ${result.bodyParts.map(part => (
+ `<p><span style="color: var(--secText);">...</span>${part}<span style="color: var(--secText);">...</span></p>`
+ )).join("")}
+ ${result.bodyOverflow ? `<p style="color: var(--secText);">+${result.bodyOverflow} more matches</p>` : ""}
+
+ <h5>
+ ${result.icons.map((icon, i) => (`<i class="fluid-icon statusIcon">${icon.icon}</i>`)).join("")}
+ </h5>
+ </div>
+ `;
+}
+
+//Fluid UI screen definitions
+fluid.externalScreens.search = (term) => {
+ dtps.globalSearch(term);
+}
+
+/**
+ * @typedef {Object} SearchData
+ * @description An object that can represent any type of data to be searched.
+ * @property {string} [title] Result title
+ * @property {string} [body] Result body (can be HTML)
+ * @property {string} [url] A URL for opening this result in the LMS
+ * @property {string} locatedIn Describes where this result was found (as specific as possible)
+ * @property {string} icon The icon to use for this result. Should match (and is displayed with) the locatedIn property.
+ * @property {Object[]} [info] Contains any info (e.g. due dates) for this result. Has an icon property, label property, and info property.
+ * @property {Object[]} icons Status icons for this result. Has an "icon" property, for the icon, and a "keywords" property for a string with all of the search keywords for the icon.
+ * @property {number} class The number of the class that this result is from
*/
\ No newline at end of file
diff --git a/server.js b/server.js
index e65fc3b..7048a60 100644
--- a/server.js
+++ b/server.js
@@ -1,40 +1,40 @@
-/**
- * @file DTPS development server
- * @author jottocraft
- *
- * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
- * @license GPL-2.0-only
- */
-
-const express = require('express');
-const app = express();
-
-var port = 2750;
-
-//Check CLI args
-process.argv.forEach(arg => {
- if (arg.startsWith("--port=")) {
- port = Number(arg.replace("--port=", ""));
- }
-})
-
-//Serve dev
-app.get('/dtps/dev', function(req, res) {
- res.send(true);
-});
-
-//Serve scripts
-app.use('/scripts', express.static('scripts'));
-
-//Serve root-level scripts
-app.use('/init.js', express.static('init.js'));
-app.use('/dtps.css', express.static('dtps.css'));
-
-//Serve www
-app.use('/', express.static('www'));
-
-app.listen(port, () => {
- console.log("The Power+ development server is listening on port " + port);
- console.log("\nGo to Settings -> About -> Advanced Options -> Enable debug config in Power+ to enable debug mode");
- console.log("Read CONTRIBUTING.md for more information");
+/**
+ * @file DTPS development server
+ * @author jottocraft
+ *
+ * @copyright Copyright (c) 2018-2020 jottocraft. All rights reserved.
+ * @license GPL-2.0-only
+ */
+
+const express = require('express');
+const app = express();
+
+var port = 2750;
+
+//Check CLI args
+process.argv.forEach(arg => {
+ if (arg.startsWith("--port=")) {
+ port = Number(arg.replace("--port=", ""));
+ }
+})
+
+//Serve dev
+app.get('/dtps/dev', function(req, res) {
+ res.send(true);
+});
+
+//Serve scripts
+app.use('/scripts', express.static('scripts'));
+
+//Serve root-level scripts
+app.use('/init.js', express.static('init.js'));
+app.use('/dtps.css', express.static('dtps.css'));
+
+//Serve www
+app.use('/', express.static('www'));
+
+app.listen(port, () => {
+ console.log("The Power+ development server is listening on port " + port);
+ console.log("\nGo to Settings -> About -> Advanced Options -> Enable debug config in Power+ to enable debug mode");
+ console.log("Read CONTRIBUTING.md for more information");
});
\ No newline at end of file
diff --git a/www/404.html b/www/404.html
index 5277691..c25030d 100644
--- a/www/404.html
+++ b/www/404.html
@@ -1,338 +1,338 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v5.min.css"
- media="screen,projection" />
- <script>
- var info = {
- title: "404",
- description: "The requested URL was not found",
- status: "fail",
- brand: {
- name: "Power+",
- image: "https://cdn.jottocraft.com/images/dtpsBitmap.png",
- favicon: "/favicon.png",
- color: "#e3ba4b"
- }
- }
- document.title = info.title + ((info.brand && (" | " + info.brand.name)) || "");
- if (info.brand && info.brand.image) document.documentElement.style.setProperty('--brandImage', "url('" + info.brand.image + "')");
- if (info.brand && info.brand.color) document.documentElement.style.setProperty('--brandColor', info.brand.color);
- </script>
- <script>document.write(`<link rel="shortcut icon" href="${info.brand && info.brand.favicon}" type="image/png">`)</script>
- <style>
- h1 {
- margin-top: 0px;
- font-size: 68px;
- text-shadow: 0px 0px 4px var(--secText);
- }
-
- h1 span {
- font-weight: bold;
- vertical-align: middle;
- }
-
- div.status {
- vertical-align: middle;
- display: inline-block;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- margin-right: 5px;
- }
-
- div.status.fail {
- border: 3px solid #792020;
- background: #e83434ba;
- box-shadow: 0 0px 20px rgb(255 60 60 / 32%);
- }
-
- div.status.success {
- border: 3px solid #185f27;
- background: #23b542ad;
- box-shadow: 0 0px 20px #3cff5952;
- }
-
- div.status.game {
- border: 3px solid #211467;
- background: #391ece8f;
- box-shadow: 0 0px 20px rgb(74 48 191 / 32%);
- }
-
- i.fail::before {
- content: "lens";
- color: #c44848;
- font-size: 32px;
- }
-
- i.success::before {
- content: "lens";
- color: #48c45d;
- font-size: 32px;
- }
-
- #background {
- background-image: var(--brandImage, url('https://cdn.jottocraft.com/images/bitmap.png'));
- opacity: 0.5;
- bottom: 80px;
- position: fixed;
- z-index: -1;
- width: 100%;
- height: 50%;
- background-position: bottom;
- background-size: auto min(50%, 600px);
- background-repeat-y: no-repeat;
- }
- </style>
-</head>
-
-
-<body>
- <div class="container center">
- <h1>
- <script>document.write(`<div id="pageStatus" class="status ${info.status}"></div>`)</script>
- <span id="pageTitle"><script>document.write(info.title)</script></span>
- <h5 id="pageDescription">
- <script>document.write(info.description)</script>
- </h5>
- </h1>
-
- <canvas style="margin-top: 40px; display: none;" width="788" height="500" id="game"></canvas>
- </div>
- <div id="background"></div>
-
- <script>
- const canvas = document.getElementById('game');
- const context = canvas.getContext('2d');
-
- const level1 = [
- [],
- [],
- [],
- [],
- ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
- ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
- ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
- ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
- ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
- ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
- ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],
- ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],
- ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y']
- ];
-
- // create a mapping between color short code (R, O, G, Y) and color name
- const colorMap = {
- //'R': '#27d69c',
- 'O': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#505ae0',
- 'G': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#4487cd',
- 'Y': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#56acbe'
- };
-
- // use a 2px gap between each brick
- const brickGap = 2;
- const brickWidth = 44;
- const brickHeight = 12;
-
- // the wall width takes up the remaining space of the canvas width. with 14 bricks
- // and 13 2px gaps between them, thats: 400 - (14 * 25 + 2 * 13) = 24px. so each
- // wall will be 12px
- const wallSize = 4;
- const bricks = [];
- var score = 0;
-
- // create the level by looping over each row and column in the level1 array
- // and creating an object with the bricks position (x, y) and color
- for (let row = 0; row < level1.length; row++) {
- for (let col = 0; col < level1[row].length; col++) {
- const colorCode = level1[row][col];
-
- bricks.push({
- x: wallSize + (brickWidth + brickGap) * col,
- y: wallSize + (brickHeight + brickGap) * row,
- color: colorMap[colorCode],
- width: brickWidth,
- height: brickHeight
- });
- }
- }
-
- const paddle = {
- // place the paddle horizontally in the middle of the screen
- x: canvas.width / 2 - brickWidth / 2,
- y: 440,
- width: brickWidth * 3,
- height: brickHeight,
-
- // paddle x velocity
- dx: 0
- };
-
- const ball = {
- x: 130,
- y: 260,
- width: 8,
- height: 8,
-
- // how fast the ball should go in either the x or y direction
- speed: 2,
-
- // ball velocity
- dx: 0,
- dy: 0
- };
-
- // check for collision between two objects using axis-aligned bounding box (AABB)
- // @see https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection
- function collides(obj1, obj2) {
- return obj1.x < obj2.x + obj2.width &&
- obj1.x + obj1.width > obj2.x &&
- obj1.y < obj2.y + obj2.height &&
- obj1.y + obj1.height > obj2.y;
- }
-
- // game loop
- function loop() {
- requestAnimationFrame(loop);
- context.clearRect(0, 0, canvas.width, canvas.height);
-
- // move paddle by it's velocity
- paddle.x += paddle.dx;
-
- // prevent paddle from going through walls
- if (paddle.x < wallSize) {
- paddle.x = wallSize
- }
- else if (paddle.x + (brickWidth * 3) > canvas.width - wallSize) {
- paddle.x = canvas.width - wallSize - (brickWidth * 3);
- }
-
- // move ball by it's velocity
- ball.x += ball.dx;
- ball.y += ball.dy;
-
- // prevent ball from going through walls by changing its velocity
- // left & right walls
- if (ball.x < wallSize) {
- ball.x = wallSize;
- ball.dx *= -1;
- }
- else if (ball.x + ball.width > canvas.width - wallSize) {
- ball.x = canvas.width - wallSize - ball.width;
- ball.dx *= -1;
- }
- // top wall
- if (ball.y < wallSize) {
- ball.y = wallSize;
- ball.dy *= -1;
- }
-
- // reset ball if it goes below the screen
- if (ball.y > canvas.height) {
- ball.x = 130;
- ball.y = 260;
- ball.dx = 0;
- ball.dy = 0;
- }
-
- // check to see if ball collides with paddle. if they do change y velocity
- if (collides(ball, paddle)) {
- ball.dy *= -1;
-
- // move ball above the paddle otherwise the collision will happen again
- // in the next frame
- ball.y = paddle.y - ball.height;
- }
-
- // check to see if ball collides with a brick. if it does, remove the brick
- // and change the ball velocity based on the side the brick was hit on
- for (let i = 0; i < bricks.length; i++) {
- const brick = bricks[i];
-
- if (collides(ball, brick)) {
- // remove brick from the bricks array
- bricks.splice(i, 1);
- score++;
- document.getElementById("pageDescription").innerText = "Score: " + score;
-
- // ball is above or below the brick, change y velocity
- // account for the balls speed since it will be inside the brick when it
- // collides
- if (ball.y + ball.height - ball.speed <= brick.y ||
- ball.y >= brick.y + brick.height - ball.speed) {
- ball.dy *= -1;
- }
- // ball is on either side of the brick, change x velocity
- else {
- ball.dx *= -1;
- }
-
- break;
- }
- }
-
- // draw walls
- context.fillStyle = getComputedStyle(document.body).getPropertyValue('--elements');
- context.fillRect(0, 0, canvas.width, wallSize);
- context.fillRect(0, 0, wallSize, canvas.height);
- context.fillRect(canvas.width - wallSize, 0, wallSize, canvas.height);
-
- // draw ball if it's moving
- context.fillStyle = getComputedStyle(document.body).getPropertyValue('--text');
- if (ball.dx || ball.dy) {
- context.fillRect(ball.x, ball.y, ball.width, ball.height);
- }
-
- // draw bricks
- bricks.forEach(function (brick) {
- context.fillStyle = brick.color;
- context.fillRect(brick.x, brick.y, brick.width, brick.height);
- });
-
- // draw paddle
- context.fillStyle = getComputedStyle(document.body).getPropertyValue('--theme');
- context.fillRect(paddle.x, paddle.y, paddle.width, paddle.height);
- }
-
- // listen to keyboard events to move the paddle
- document.addEventListener('keydown', function (e) {
- // left arrow key
- if (e.which === 37) {
- paddle.dx = -3;
- }
- // right arrow key
- else if (e.which === 39) {
- paddle.dx = 3;
- }
-
- // space key
- // if they ball is not moving, we can launch the ball using the space key. ball
- // will move towards the bottom right to start
- if (ball.dx === 0 && ball.dy === 0 && e.which === 32) {
- ball.dx = ball.speed;
- ball.dy = ball.speed;
- }
-
- if (e.which === 32) {
- document.getElementById("game").style.display = "";
- document.getElementById("background").style.display = "none";
- document.getElementById("pageStatus").classList.add("game");
- document.getElementById("pageTitle").innerText = "302";
- document.getElementById("pageDescription").innerText = "Score: " + score;
- }
- });
-
- // listen to keyboard events to stop the paddle if key is released
- document.addEventListener('keyup', function (e) {
- if (((e.which === 37) && (paddle.dx == -3)) || ((e.which === 39) && (paddle.dx == 3))) {
- paddle.dx = 0;
- }
- });
-
- // start the game
- requestAnimationFrame(loop);
- </script>
-</body>
-
+<!DOCTYPE html>
+<html>
+
+<head>
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v5.min.css"
+ media="screen,projection" />
+ <script>
+ var info = {
+ title: "404",
+ description: "The requested URL was not found",
+ status: "fail",
+ brand: {
+ name: "Power+",
+ image: "https://cdn.jottocraft.com/images/dtpsBitmap.png",
+ favicon: "/favicon.png",
+ color: "#e3ba4b"
+ }
+ }
+ document.title = info.title + ((info.brand && (" | " + info.brand.name)) || "");
+ if (info.brand && info.brand.image) document.documentElement.style.setProperty('--brandImage', "url('" + info.brand.image + "')");
+ if (info.brand && info.brand.color) document.documentElement.style.setProperty('--brandColor', info.brand.color);
+ </script>
+ <script>document.write(`<link rel="shortcut icon" href="${info.brand && info.brand.favicon}" type="image/png">`)</script>
+ <style>
+ h1 {
+ margin-top: 0px;
+ font-size: 68px;
+ text-shadow: 0px 0px 4px var(--secText);
+ }
+
+ h1 span {
+ font-weight: bold;
+ vertical-align: middle;
+ }
+
+ div.status {
+ vertical-align: middle;
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ margin-right: 5px;
+ }
+
+ div.status.fail {
+ border: 3px solid #792020;
+ background: #e83434ba;
+ box-shadow: 0 0px 20px rgb(255 60 60 / 32%);
+ }
+
+ div.status.success {
+ border: 3px solid #185f27;
+ background: #23b542ad;
+ box-shadow: 0 0px 20px #3cff5952;
+ }
+
+ div.status.game {
+ border: 3px solid #211467;
+ background: #391ece8f;
+ box-shadow: 0 0px 20px rgb(74 48 191 / 32%);
+ }
+
+ i.fail::before {
+ content: "lens";
+ color: #c44848;
+ font-size: 32px;
+ }
+
+ i.success::before {
+ content: "lens";
+ color: #48c45d;
+ font-size: 32px;
+ }
+
+ #background {
+ background-image: var(--brandImage, url('https://cdn.jottocraft.com/images/bitmap.png'));
+ opacity: 0.5;
+ bottom: 80px;
+ position: fixed;
+ z-index: -1;
+ width: 100%;
+ height: 50%;
+ background-position: bottom;
+ background-size: auto min(50%, 600px);
+ background-repeat-y: no-repeat;
+ }
+ </style>
+</head>
+
+
+<body>
+ <div class="container center">
+ <h1>
+ <script>document.write(`<div id="pageStatus" class="status ${info.status}"></div>`)</script>
+ <span id="pageTitle"><script>document.write(info.title)</script></span>
+ <h5 id="pageDescription">
+ <script>document.write(info.description)</script>
+ </h5>
+ </h1>
+
+ <canvas style="margin-top: 40px; display: none;" width="788" height="500" id="game"></canvas>
+ </div>
+ <div id="background"></div>
+
+ <script>
+ const canvas = document.getElementById('game');
+ const context = canvas.getContext('2d');
+
+ const level1 = [
+ [],
+ [],
+ [],
+ [],
+ ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
+ ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
+ ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'],
+ ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
+ ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
+ ['G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G'],
+ ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],
+ ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],
+ ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y']
+ ];
+
+ // create a mapping between color short code (R, O, G, Y) and color name
+ const colorMap = {
+ //'R': '#27d69c',
+ 'O': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#505ae0',
+ 'G': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#4487cd',
+ 'Y': getComputedStyle(document.body).getPropertyValue('--brandColor') || '#56acbe'
+ };
+
+ // use a 2px gap between each brick
+ const brickGap = 2;
+ const brickWidth = 44;
+ const brickHeight = 12;
+
+ // the wall width takes up the remaining space of the canvas width. with 14 bricks
+ // and 13 2px gaps between them, thats: 400 - (14 * 25 + 2 * 13) = 24px. so each
+ // wall will be 12px
+ const wallSize = 4;
+ const bricks = [];
+ var score = 0;
+
+ // create the level by looping over each row and column in the level1 array
+ // and creating an object with the bricks position (x, y) and color
+ for (let row = 0; row < level1.length; row++) {
+ for (let col = 0; col < level1[row].length; col++) {
+ const colorCode = level1[row][col];
+
+ bricks.push({
+ x: wallSize + (brickWidth + brickGap) * col,
+ y: wallSize + (brickHeight + brickGap) * row,
+ color: colorMap[colorCode],
+ width: brickWidth,
+ height: brickHeight
+ });
+ }
+ }
+
+ const paddle = {
+ // place the paddle horizontally in the middle of the screen
+ x: canvas.width / 2 - brickWidth / 2,
+ y: 440,
+ width: brickWidth * 3,
+ height: brickHeight,
+
+ // paddle x velocity
+ dx: 0
+ };
+
+ const ball = {
+ x: 130,
+ y: 260,
+ width: 8,
+ height: 8,
+
+ // how fast the ball should go in either the x or y direction
+ speed: 2,
+
+ // ball velocity
+ dx: 0,
+ dy: 0
+ };
+
+ // check for collision between two objects using axis-aligned bounding box (AABB)
+ // @see https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection
+ function collides(obj1, obj2) {
+ return obj1.x < obj2.x + obj2.width &&
+ obj1.x + obj1.width > obj2.x &&
+ obj1.y < obj2.y + obj2.height &&
+ obj1.y + obj1.height > obj2.y;
+ }
+
+ // game loop
+ function loop() {
+ requestAnimationFrame(loop);
+ context.clearRect(0, 0, canvas.width, canvas.height);
+
+ // move paddle by it's velocity
+ paddle.x += paddle.dx;
+
+ // prevent paddle from going through walls
+ if (paddle.x < wallSize) {
+ paddle.x = wallSize
+ }
+ else if (paddle.x + (brickWidth * 3) > canvas.width - wallSize) {
+ paddle.x = canvas.width - wallSize - (brickWidth * 3);
+ }
+
+ // move ball by it's velocity
+ ball.x += ball.dx;
+ ball.y += ball.dy;
+
+ // prevent ball from going through walls by changing its velocity
+ // left & right walls
+ if (ball.x < wallSize) {
+ ball.x = wallSize;
+ ball.dx *= -1;
+ }
+ else if (ball.x + ball.width > canvas.width - wallSize) {
+ ball.x = canvas.width - wallSize - ball.width;
+ ball.dx *= -1;
+ }
+ // top wall
+ if (ball.y < wallSize) {
+ ball.y = wallSize;
+ ball.dy *= -1;
+ }
+
+ // reset ball if it goes below the screen
+ if (ball.y > canvas.height) {
+ ball.x = 130;
+ ball.y = 260;
+ ball.dx = 0;
+ ball.dy = 0;
+ }
+
+ // check to see if ball collides with paddle. if they do change y velocity
+ if (collides(ball, paddle)) {
+ ball.dy *= -1;
+
+ // move ball above the paddle otherwise the collision will happen again
+ // in the next frame
+ ball.y = paddle.y - ball.height;
+ }
+
+ // check to see if ball collides with a brick. if it does, remove the brick
+ // and change the ball velocity based on the side the brick was hit on
+ for (let i = 0; i < bricks.length; i++) {
+ const brick = bricks[i];
+
+ if (collides(ball, brick)) {
+ // remove brick from the bricks array
+ bricks.splice(i, 1);
+ score++;
+ document.getElementById("pageDescription").innerText = "Score: " + score;
+
+ // ball is above or below the brick, change y velocity
+ // account for the balls speed since it will be inside the brick when it
+ // collides
+ if (ball.y + ball.height - ball.speed <= brick.y ||
+ ball.y >= brick.y + brick.height - ball.speed) {
+ ball.dy *= -1;
+ }
+ // ball is on either side of the brick, change x velocity
+ else {
+ ball.dx *= -1;
+ }
+
+ break;
+ }
+ }
+
+ // draw walls
+ context.fillStyle = getComputedStyle(document.body).getPropertyValue('--elements');
+ context.fillRect(0, 0, canvas.width, wallSize);
+ context.fillRect(0, 0, wallSize, canvas.height);
+ context.fillRect(canvas.width - wallSize, 0, wallSize, canvas.height);
+
+ // draw ball if it's moving
+ context.fillStyle = getComputedStyle(document.body).getPropertyValue('--text');
+ if (ball.dx || ball.dy) {
+ context.fillRect(ball.x, ball.y, ball.width, ball.height);
+ }
+
+ // draw bricks
+ bricks.forEach(function (brick) {
+ context.fillStyle = brick.color;
+ context.fillRect(brick.x, brick.y, brick.width, brick.height);
+ });
+
+ // draw paddle
+ context.fillStyle = getComputedStyle(document.body).getPropertyValue('--theme');
+ context.fillRect(paddle.x, paddle.y, paddle.width, paddle.height);
+ }
+
+ // listen to keyboard events to move the paddle
+ document.addEventListener('keydown', function (e) {
+ // left arrow key
+ if (e.which === 37) {
+ paddle.dx = -3;
+ }
+ // right arrow key
+ else if (e.which === 39) {
+ paddle.dx = 3;
+ }
+
+ // space key
+ // if they ball is not moving, we can launch the ball using the space key. ball
+ // will move towards the bottom right to start
+ if (ball.dx === 0 && ball.dy === 0 && e.which === 32) {
+ ball.dx = ball.speed;
+ ball.dy = ball.speed;
+ }
+
+ if (e.which === 32) {
+ document.getElementById("game").style.display = "";
+ document.getElementById("background").style.display = "none";
+ document.getElementById("pageStatus").classList.add("game");
+ document.getElementById("pageTitle").innerText = "302";
+ document.getElementById("pageDescription").innerText = "Score: " + score;
+ }
+ });
+
+ // listen to keyboard events to stop the paddle if key is released
+ document.addEventListener('keyup', function (e) {
+ if (((e.which === 37) && (paddle.dx == -3)) || ((e.which === 39) && (paddle.dx == 3))) {
+ paddle.dx = 0;
+ }
+ });
+
+ // start the game
+ requestAnimationFrame(loop);
+ </script>
+</body>
+
</html>
\ No newline at end of file
diff --git a/www/demo/index.html b/www/demo/index.html
index 75381e6..982de87 100644
--- a/www/demo/index.html
+++ b/www/demo/index.html
@@ -1,72 +1,72 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <link dtps="true" rel="shortcut icon" href="https://powerplus.app/favicon.png" type="image/png">
- <meta dtps="true" name="viewport" content="width=device-width, initial-scale=1">
- <meta dtps="true" charset="utf-8">
- <title dtps="true">Power+ Demo</title>
- <meta dtps="true" name="description" content="Power+ demonstration website">
- <meta dtps="true" name="author" content="jottocraft">
- <script dtps="true">window.dtpsPreLoader = true; window.dtpsBaseURL = "https://powerplus.app";</script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" dtps="true"></script>
- <script src="https://powerplus.app/scripts/lms/demo.js" dtps="true"></script>
-</head>
-
-
-<body>
- <div dtps="true" id="dtpsNativeOverlay"
- style="background-color: #151515; position: fixed; top: 0px; left: 0px; width: 100%; height: 100vh; z-index: 99;text-align: center;z-index: 999;transition: opacity 0.2s;">
- <img dtps="true" style="height: 100px; margin-top: 132px;" src="https://i.imgur.com/7dDUVh2.png" />
- <br dtps="true" />
- <div dtps="true" class="progress">
- <div dtps="true" class="indeterminate"></div>
- </div>
- <style dtps="true">
- body {
- background-color: #151515;
- overflow: hidden;
- }
-
- *,
- :after,
- :before {
- box-sizing: border-box
- }
-
- .progress {
- position: relative;
- width: 600px;
- height: 5px;
- overflow: hidden;
- border-radius: 12px;
- background: #262626;
- backdrop-filter: opacity(.4);
- display: inline-block;
- margin-top: 75px
- }
-
- .progress .indeterminate {
- position: absolute;
- background: #e3ba4b;
- height: 5px;
- animation: indeterminate 1.4s infinite;
- animation-timing-function: linear
- }
-
- @keyframes indeterminate {
- 0% {
- width: 5%;
- left: -15%
- }
-
- to {
- width: 100%;
- left: 110%
- }
- }
- </style>
- </div>
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <link dtps="true" rel="shortcut icon" href="https://powerplus.app/favicon.png" type="image/png">
+ <meta dtps="true" name="viewport" content="width=device-width, initial-scale=1">
+ <meta dtps="true" charset="utf-8">
+ <title dtps="true">Power+ Demo</title>
+ <meta dtps="true" name="description" content="Power+ demonstration website">
+ <meta dtps="true" name="author" content="jottocraft">
+ <script dtps="true">window.dtpsPreLoader = true; window.dtpsBaseURL = "https://powerplus.app";</script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" dtps="true"></script>
+ <script src="https://powerplus.app/scripts/lms/demo.js" dtps="true"></script>
+</head>
+
+
+<body>
+ <div dtps="true" id="dtpsNativeOverlay"
+ style="background-color: #151515; position: fixed; top: 0px; left: 0px; width: 100%; height: 100vh; z-index: 99;text-align: center;z-index: 999;transition: opacity 0.2s;">
+ <img dtps="true" style="height: 100px; margin-top: 132px;" src="https://i.imgur.com/7dDUVh2.png" />
+ <br dtps="true" />
+ <div dtps="true" class="progress">
+ <div dtps="true" class="indeterminate"></div>
+ </div>
+ <style dtps="true">
+ body {
+ background-color: #151515;
+ overflow: hidden;
+ }
+
+ *,
+ :after,
+ :before {
+ box-sizing: border-box
+ }
+
+ .progress {
+ position: relative;
+ width: 600px;
+ height: 5px;
+ overflow: hidden;
+ border-radius: 12px;
+ background: #262626;
+ backdrop-filter: opacity(.4);
+ display: inline-block;
+ margin-top: 75px
+ }
+
+ .progress .indeterminate {
+ position: absolute;
+ background: #e3ba4b;
+ height: 5px;
+ animation: indeterminate 1.4s infinite;
+ animation-timing-function: linear
+ }
+
+ @keyframes indeterminate {
+ 0% {
+ width: 5%;
+ left: -15%
+ }
+
+ to {
+ width: 100%;
+ left: 110%
+ }
+ }
+ </style>
+ </div>
+</body>
+
</html>
\ No newline at end of file
diff --git a/www/dev/index.html b/www/dev/index.html
index c563c48..ba8526f 100644
--- a/www/dev/index.html
+++ b/www/dev/index.html
@@ -1,166 +1,166 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-
- <link rel="shortcut icon" href="/favicon.png" type="image/png">
-
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Extended" rel="stylesheet">
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v4.min.css"
- media="screen,projection" />
-
- <!--OpenGraph -->
- <meta property="og:url" content="https://powerplus.app" />
- <meta property="og:title" content="Power+" />
- <meta property="og:description" content="A better UI for Canvas LMS" />
- <meta property="og:image" content="https://powerplus.app/logo.png" />
-
- <title>Power+</title>
-
- <meta charset="utf-8">
- <meta name="description" content="A better UI for Canvas LMS">
- <meta name="author" content="jottocraft">
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
- <script async src="https://cdn.jottocraft.com/fluid/assets/tinycolor.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="https://cdn.jottocraft.com/fluid/v4.min.js"></script>
-
- <style>
- /* Header */
- #header {
- color: var(--elementText);
- padding: 100px;
- padding-bottom: 120px;
- text-align: center;
- }
-
- #header h1 {
- display: inline-block;
- vertical-align: middle;
- }
-
- .title img {
- height: 98px;
- vertical-align: middle;
- margin-right: 22px;
- }
-
- #header .title {
- margin-bottom: 40px;
- }
-
- /* Content Blocks */
- .block {
- overflow: hidden;
- margin-bottom: 200px;
- }
-
- .container .block .description>*:nth-child(1) {
- margin-top: 0px;
- }
-
- .container .block .description>*:nth-last-child(1) {
- margin-bottom: 0px;
- }
-
- .container .block .description p {
- font-size: 20px;
- color: var(--lightText);
- }
-
- /* Large content blocks */
- .container .block:not(.small)>img {
- width: 28%;
- max-width: 250px;
- }
-
- .container .block:not(.small)>.description {
- overflow: hidden;
- }
-
- .container .block:not(.small):nth-child(odd)>img,
- .container .block.left:not(.small):nth-child(even)>img {
- float: left;
- margin-right: 48px;
- margin-left: 0;
- }
-
- .container .block:not(.small):nth-child(even)>img,
- .container .block.right:not(.small):nth-child(odd)>img {
- float: right;
- margin-left: 48px;
- margin-right: 0;
- }
-
- .container .block:not(.small) .description h3 {
- font-size: 2.6rem;
- }
-
- /* Small content blocks */
- .container .block.small .description h3 {
- font-size: 2.2rem;
- }
-
- .container .block.small {
- text-align: center;
- display: inline-block;
- }
-
- .container .block.small img {
- height: 150px;
- margin-bottom: 20px;
- }
- </style>
-</head>
-
-
-<body>
- <div id="header">
- <div class="content">
- <div class="title">
- <img src="/icon.svg" />
- <h1>Power+ (dev)</h1>
- </div>
- <div class="row">
- <button
- onclick="fluid.alert('Send Feedback', 'Email [email protected] to send feedback about Power+ (dev)', 'email')"
- class="btn"><i class="material-icons">feedback</i> Send Feedback</button>
- <button onclick="window.location.href = 'https://github.com/jottocraft/dtps/issues/new';" class="btn"><i
- class="material-icons">bug_report</i> Report a bug</button>
- <button onclick="window.location.href = '/docs';" class="btn outline"><i
- class="material-icons">article</i> Documentation</button>
- <button class="btn outline"
- onclick="window.location.href = 'https://github.com/jottocraft/dtps/tree/dev';"><i
- class="material-icons">code</i> Source code</button>
- </div>
- </div>
- </div>
-
- <div class="container">
- <div style="background: var(--elements); padding: 40px; border-radius: var(--cardRadius);" class="block left">
- <img src="assets/dev.svg" />
- <div class="description">
- <h3>Development Status</h3>
- <p>Feature freeze - v3.1.0 (scheduled for stable release in January 2021)</p>
- <span>To start using the dev version of Power+, visit Settings -> About -> Advanced Options and
- select "Test prerelease versions". Then, navigate to Settings -> Prerelease testing and select
- "Dev". Once you've done that, just reload Power+ to load the dev version. Keep in mind that the
- dev version uses the latest, often untested, code and can completely break. Use the dev version
- at your own risk.</span>
- </div>
- </div>
- </div>
-
- <div style="text-align: center; padding-bottom: 50px;">
- <img style="height: 45px; margin-right: 20px; vertical-align: middle;"
- src="https://cdn.jottocraft.com/images/footerImage.png" />
- <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
- <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source
- code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
- </div>
-
-
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+
+ <link rel="shortcut icon" href="/favicon.png" type="image/png">
+
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Extended" rel="stylesheet">
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v4.min.css"
+ media="screen,projection" />
+
+ <!--OpenGraph -->
+ <meta property="og:url" content="https://powerplus.app" />
+ <meta property="og:title" content="Power+" />
+ <meta property="og:description" content="A better UI for Canvas LMS" />
+ <meta property="og:image" content="https://powerplus.app/logo.png" />
+
+ <title>Power+</title>
+
+ <meta charset="utf-8">
+ <meta name="description" content="A better UI for Canvas LMS">
+ <meta name="author" content="jottocraft">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
+ <script async src="https://cdn.jottocraft.com/fluid/assets/tinycolor.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
+ <script src="https://cdn.jottocraft.com/fluid/v4.min.js"></script>
+
+ <style>
+ /* Header */
+ #header {
+ color: var(--elementText);
+ padding: 100px;
+ padding-bottom: 120px;
+ text-align: center;
+ }
+
+ #header h1 {
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ .title img {
+ height: 98px;
+ vertical-align: middle;
+ margin-right: 22px;
+ }
+
+ #header .title {
+ margin-bottom: 40px;
+ }
+
+ /* Content Blocks */
+ .block {
+ overflow: hidden;
+ margin-bottom: 200px;
+ }
+
+ .container .block .description>*:nth-child(1) {
+ margin-top: 0px;
+ }
+
+ .container .block .description>*:nth-last-child(1) {
+ margin-bottom: 0px;
+ }
+
+ .container .block .description p {
+ font-size: 20px;
+ color: var(--lightText);
+ }
+
+ /* Large content blocks */
+ .container .block:not(.small)>img {
+ width: 28%;
+ max-width: 250px;
+ }
+
+ .container .block:not(.small)>.description {
+ overflow: hidden;
+ }
+
+ .container .block:not(.small):nth-child(odd)>img,
+ .container .block.left:not(.small):nth-child(even)>img {
+ float: left;
+ margin-right: 48px;
+ margin-left: 0;
+ }
+
+ .container .block:not(.small):nth-child(even)>img,
+ .container .block.right:not(.small):nth-child(odd)>img {
+ float: right;
+ margin-left: 48px;
+ margin-right: 0;
+ }
+
+ .container .block:not(.small) .description h3 {
+ font-size: 2.6rem;
+ }
+
+ /* Small content blocks */
+ .container .block.small .description h3 {
+ font-size: 2.2rem;
+ }
+
+ .container .block.small {
+ text-align: center;
+ display: inline-block;
+ }
+
+ .container .block.small img {
+ height: 150px;
+ margin-bottom: 20px;
+ }
+ </style>
+</head>
+
+
+<body>
+ <div id="header">
+ <div class="content">
+ <div class="title">
+ <img src="/icon.svg" />
+ <h1>Power+ (dev)</h1>
+ </div>
+ <div class="row">
+ <button
+ onclick="fluid.alert('Send Feedback', 'Email [email protected] to send feedback about Power+ (dev)', 'email')"
+ class="btn"><i class="material-icons">feedback</i> Send Feedback</button>
+ <button onclick="window.location.href = 'https://github.com/jottocraft/dtps/issues/new';" class="btn"><i
+ class="material-icons">bug_report</i> Report a bug</button>
+ <button onclick="window.location.href = '/docs';" class="btn outline"><i
+ class="material-icons">article</i> Documentation</button>
+ <button class="btn outline"
+ onclick="window.location.href = 'https://github.com/jottocraft/dtps/tree/dev';"><i
+ class="material-icons">code</i> Source code</button>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div style="background: var(--elements); padding: 40px; border-radius: var(--cardRadius);" class="block left">
+ <img src="assets/dev.svg" />
+ <div class="description">
+ <h3>Development Status</h3>
+ <p>Feature freeze - v3.1.0 (scheduled for stable release in January 2021)</p>
+ <span>To start using the dev version of Power+, visit Settings -> About -> Advanced Options and
+ select "Test prerelease versions". Then, navigate to Settings -> Prerelease testing and select
+ "Dev". Once you've done that, just reload Power+ to load the dev version. Keep in mind that the
+ dev version uses the latest, often untested, code and can completely break. Use the dev version
+ at your own risk.</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="text-align: center; padding-bottom: 50px;">
+ <img style="height: 45px; margin-right: 20px; vertical-align: middle;"
+ src="https://cdn.jottocraft.com/images/footerImage.png" />
+ <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
+ <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source
+ code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
+ </div>
+
+
+</body>
+
</html>
\ No newline at end of file
diff --git a/www/icon.svg b/www/icon.svg
index 79d1ecc..e5ec872 100644
--- a/www/icon.svg
+++ b/www/icon.svg
@@ -1,89 +1,89 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- fill="#1a1a1a"
- version="1.1"
- viewBox="8 0 49 65.539238"
- x="0px"
- y="0px"
- id="svg6"
- sodipodi:docname="new power+ prototype.svg"
- width="49"
- height="65.539238"
- inkscape:version="1.0 (4035a4fb49, 2020-05-01)">
- <metadata
- id="metadata12">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title>book-bookmark</dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs10">
- <linearGradient
- inkscape:collect="always"
- id="linearGradient841">
- <stop
- style="stop-color:#e3ba4b;stop-opacity:1"
- offset="0"
- id="stop837" />
- <stop
- style="stop-color:#f5c669;stop-opacity:1"
- offset="1"
- id="stop839" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient841"
- id="linearGradient843"
- x1="7.0668874"
- y1="-1.5925453"
- x2="57.066414"
- y2="65.191643"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(0.5,0.5)" />
- </defs>
- <sodipodi:namedview
- inkscape:document-rotation="0"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1368"
- inkscape:window-height="850"
- id="namedview8"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:zoom="7.501776"
- inkscape:cx="24.96859"
- inkscape:cy="35.965696"
- inkscape:window-x="-6"
- inkscape:window-y="-6"
- inkscape:window-maximized="1"
- inkscape:current-layer="svg6" />
- <title
- id="title2">book-bookmark</title>
- <path
- d="M 13.833,0.5 C 10.887,0.5 8.5,2.9 8.5,5.833 v 48 c 0,2.933 2.388,5.333 5.333,5.333 h 5.333 v 5.333 l 6.667,-5.333 6.667,5.333 v -5.333 h 18.667 c 2.947,0 5.333,-2.4 5.333,-5.333 v -2.667 c 0,2.933 -2.387,5.333 -5.333,5.333 H 32.5 V 51.166 H 19.167 v 5.333 h -4 c -2.209,0 -4,-1.867 -4,-4 0,-2.4 1.791,-4 4,-4 h 36 c 2.947,0 5.333,-2.4 5.333,-5.333 V 5.833 C 56.5,2.9 54.113,0.5 51.167,0.5 H 13.834 Z"
- id="path4"
- style="fill:url(#linearGradient843);fill-opacity:1;stroke:#daaf3c;stroke-opacity:1" />
-</svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ fill="#1a1a1a"
+ version="1.1"
+ viewBox="8 0 49 65.539238"
+ x="0px"
+ y="0px"
+ id="svg6"
+ sodipodi:docname="new power+ prototype.svg"
+ width="49"
+ height="65.539238"
+ inkscape:version="1.0 (4035a4fb49, 2020-05-01)">
+ <metadata
+ id="metadata12">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>book-bookmark</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs10">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient841">
+ <stop
+ style="stop-color:#e3ba4b;stop-opacity:1"
+ offset="0"
+ id="stop837" />
+ <stop
+ style="stop-color:#f5c669;stop-opacity:1"
+ offset="1"
+ id="stop839" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient841"
+ id="linearGradient843"
+ x1="7.0668874"
+ y1="-1.5925453"
+ x2="57.066414"
+ y2="65.191643"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0.5,0.5)" />
+ </defs>
+ <sodipodi:namedview
+ inkscape:document-rotation="0"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1368"
+ inkscape:window-height="850"
+ id="namedview8"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:zoom="7.501776"
+ inkscape:cx="24.96859"
+ inkscape:cy="35.965696"
+ inkscape:window-x="-6"
+ inkscape:window-y="-6"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg6" />
+ <title
+ id="title2">book-bookmark</title>
+ <path
+ d="M 13.833,0.5 C 10.887,0.5 8.5,2.9 8.5,5.833 v 48 c 0,2.933 2.388,5.333 5.333,5.333 h 5.333 v 5.333 l 6.667,-5.333 6.667,5.333 v -5.333 h 18.667 c 2.947,0 5.333,-2.4 5.333,-5.333 v -2.667 c 0,2.933 -2.387,5.333 -5.333,5.333 H 32.5 V 51.166 H 19.167 v 5.333 h -4 c -2.209,0 -4,-1.867 -4,-4 0,-2.4 1.791,-4 4,-4 h 36 c 2.947,0 5.333,-2.4 5.333,-5.333 V 5.833 C 56.5,2.9 54.113,0.5 51.167,0.5 H 13.834 Z"
+ id="path4"
+ style="fill:url(#linearGradient843);fill-opacity:1;stroke:#daaf3c;stroke-opacity:1" />
+</svg>
diff --git a/www/index.html b/www/index.html
index 8bab87e..d114847 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,197 +1,197 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-
- <link rel="shortcut icon" href="/favicon.png" type="image/png">
-
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Extended" rel="stylesheet">
- <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v4.min.css"
- media="screen,projection" />
-
- <!--OpenGraph -->
- <meta property="og:url" content="https://powerplus.app" />
- <meta property="og:title" content="Power+" />
- <meta property="og:description" content="A better UI for Canvas LMS" />
- <meta property="og:image" content="https://powerplus.app/logo.png" />
-
- <title>Power+</title>
-
- <meta charset="utf-8">
- <meta name="description" content="A better UI for Canvas LMS">
- <meta name="author" content="jottocraft">
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
- <script async src="https://cdn.jottocraft.com/fluid/assets/tinycolor.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="https://cdn.jottocraft.com/fluid/v4.min.js"></script>
-
- <style>
- /* Header */
- #header {
- color: var(--elementText);
- padding: 100px;
- padding-bottom: 120px;
- margin-bottom: 125px;
- text-align: center;
- }
-
- #header h1 {
- display: inline-block;
- vertical-align: middle;
- }
-
- .title img {
- height: 98px;
- vertical-align: middle;
- margin-right: 22px;
- }
-
- #header .title {
- margin-bottom: 40px;
- }
-
- /* Content Blocks */
- .block {
- overflow: hidden;
- margin-bottom: 200px;
- }
-
- .container .block .description>*:nth-child(1) {
- margin-top: 0px;
- }
-
- .container .block .description>*:nth-last-child(1) {
- margin-bottom: 0px;
- }
-
- .container .block .description p {
- font-size: 20px;
- color: var(--lightText);
- }
-
- /* Large content blocks */
- .container .block:not(.small)>img {
- width: 28%;
- max-width: 250px;
- }
-
- .container .block:not(.small)>.description {
- overflow: hidden;
- }
-
- .container .block:not(.small):nth-child(odd)>img,
- .container .block.left:not(.small):nth-child(even)>img {
- float: left;
- margin-right: 48px;
- margin-left: 0;
- }
-
- .container .block:not(.small):nth-child(even)>img,
- .container .block.right:not(.small):nth-child(odd)>img {
- float: right;
- margin-left: 48px;
- margin-right: 0;
- }
-
- .container .block:not(.small) .description h3 {
- font-size: 2.6rem;
- }
-
- /* Small content blocks */
- .container .block.small .description h3 {
- font-size: 2.2rem;
- }
-
- .container .block.small {
- text-align: center;
- display: inline-block;
- }
-
- .container .block.small img {
- height: 150px;
- margin-bottom: 20px;
- }
- </style>
-</head>
-
-
-<body>
-
- <script>
- $(document).ready(() => {
- if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
- if ($("#dtpsInstallBtn").text().includes("extension")) {
- $("#dtpsInstallBtn").attr("onclick", "window.location.href = 'https://powerplus.app/firefox.xpi';");
- }
- }
- })
- </script>
-
- <div id="header">
- <div class="content">
- <div class="title">
- <img src="/icon.svg" />
- <h1>Power+</h1>
- </div>
- <div class="row">
- <button id="dtpsInstallBtn"
- onclick="window.location.href = 'https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo';"
- class="btn"><i class="material-icons">extension</i> Add the extension</button>
- <button class="btn outline" onclick="window.location.href = '/demo';"><i
- class="material-icons">exit_to_app</i> Demo</button>
- <button class="btn outline" onclick="window.location.href = 'https://github.com/jottocraft/dtps';"><i
- class="material-icons">code</i> Source code</button>
- </div>
- </div>
- </div>
-
- <div class="container">
- <div class="row">
- <div class="block small six columns">
- <img src="assets/todo.svg" />
- <div class="description">
- <h3>Manage your coursework</h3>
- <p>Power+ shows you upcoming assignments, a calendar, and updates at a glance</p>
- </div>
- </div>
-
- <div class="block small six columns">
- <img src="assets/calculator.svg" />
- <div class="description">
- <h3>Grade Calculation</h3>
- <p>Power+ calculates your CBL class grades and lets you test what-if grades</p>
- </div>
- </div>
- </div>
-
- <div class="block left">
- <img src="assets/server.svg" />
- <div class="description">
- <h3>Privacy</h3>
- <ul>
- <li>Power+ does not collect any personal information</li>
- <li>Power+ gets data directly from Canvas to your computer without being processed by a Power+
- server or a 3rd party</li>
- <li>Grades are calculated on-device</li>
- <li>Prefrences and grade history are stored on-device</li>
- <li>Power+'s code is open-source and hosted directly from <a
- href="https://github.com/jottocraft/dtps">GitHub</a></li>
- </ul>
- </div>
- </div>
- </div>
-
- <br /><br /><br /><br />
- <div style="text-align: center; padding: 50px 0px;">
- <img style="height: 45px; margin-right: 20px; vertical-align: middle;"
- src="https://cdn.jottocraft.com/images/footerImage.png" />
- <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
- <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source
- code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
- </div>
-
-
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+
+ <link rel="shortcut icon" href="/favicon.png" type="image/png">
+
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Extended" rel="stylesheet">
+ <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/fluid/v4.min.css"
+ media="screen,projection" />
+
+ <!--OpenGraph -->
+ <meta property="og:url" content="https://powerplus.app" />
+ <meta property="og:title" content="Power+" />
+ <meta property="og:description" content="A better UI for Canvas LMS" />
+ <meta property="og:image" content="https://powerplus.app/logo.png" />
+
+ <title>Power+</title>
+
+ <meta charset="utf-8">
+ <meta name="description" content="A better UI for Canvas LMS">
+ <meta name="author" content="jottocraft">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
+ <script async src="https://cdn.jottocraft.com/fluid/assets/tinycolor.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
+ <script src="https://cdn.jottocraft.com/fluid/v4.min.js"></script>
+
+ <style>
+ /* Header */
+ #header {
+ color: var(--elementText);
+ padding: 100px;
+ padding-bottom: 120px;
+ margin-bottom: 125px;
+ text-align: center;
+ }
+
+ #header h1 {
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ .title img {
+ height: 98px;
+ vertical-align: middle;
+ margin-right: 22px;
+ }
+
+ #header .title {
+ margin-bottom: 40px;
+ }
+
+ /* Content Blocks */
+ .block {
+ overflow: hidden;
+ margin-bottom: 200px;
+ }
+
+ .container .block .description>*:nth-child(1) {
+ margin-top: 0px;
+ }
+
+ .container .block .description>*:nth-last-child(1) {
+ margin-bottom: 0px;
+ }
+
+ .container .block .description p {
+ font-size: 20px;
+ color: var(--lightText);
+ }
+
+ /* Large content blocks */
+ .container .block:not(.small)>img {
+ width: 28%;
+ max-width: 250px;
+ }
+
+ .container .block:not(.small)>.description {
+ overflow: hidden;
+ }
+
+ .container .block:not(.small):nth-child(odd)>img,
+ .container .block.left:not(.small):nth-child(even)>img {
+ float: left;
+ margin-right: 48px;
+ margin-left: 0;
+ }
+
+ .container .block:not(.small):nth-child(even)>img,
+ .container .block.right:not(.small):nth-child(odd)>img {
+ float: right;
+ margin-left: 48px;
+ margin-right: 0;
+ }
+
+ .container .block:not(.small) .description h3 {
+ font-size: 2.6rem;
+ }
+
+ /* Small content blocks */
+ .container .block.small .description h3 {
+ font-size: 2.2rem;
+ }
+
+ .container .block.small {
+ text-align: center;
+ display: inline-block;
+ }
+
+ .container .block.small img {
+ height: 150px;
+ margin-bottom: 20px;
+ }
+ </style>
+</head>
+
+
+<body>
+
+ <script>
+ $(document).ready(() => {
+ if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
+ if ($("#dtpsInstallBtn").text().includes("extension")) {
+ $("#dtpsInstallBtn").attr("onclick", "window.location.href = 'https://powerplus.app/firefox.xpi';");
+ }
+ }
+ })
+ </script>
+
+ <div id="header">
+ <div class="content">
+ <div class="title">
+ <img src="/icon.svg" />
+ <h1>Power+</h1>
+ </div>
+ <div class="row">
+ <button id="dtpsInstallBtn"
+ onclick="window.location.href = 'https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo';"
+ class="btn"><i class="material-icons">extension</i> Add the extension</button>
+ <button class="btn outline" onclick="window.location.href = '/demo';"><i
+ class="material-icons">exit_to_app</i> Demo</button>
+ <button class="btn outline" onclick="window.location.href = 'https://github.com/jottocraft/dtps';"><i
+ class="material-icons">code</i> Source code</button>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="row">
+ <div class="block small six columns">
+ <img src="assets/todo.svg" />
+ <div class="description">
+ <h3>Manage your coursework</h3>
+ <p>Power+ shows you upcoming assignments, a calendar, and updates at a glance</p>
+ </div>
+ </div>
+
+ <div class="block small six columns">
+ <img src="assets/calculator.svg" />
+ <div class="description">
+ <h3>Grade Calculation</h3>
+ <p>Power+ calculates your CBL class grades and lets you test what-if grades</p>
+ </div>
+ </div>
+ </div>
+
+ <div class="block left">
+ <img src="assets/server.svg" />
+ <div class="description">
+ <h3>Privacy</h3>
+ <ul>
+ <li>Power+ does not collect any personal information</li>
+ <li>Power+ gets data directly from Canvas to your computer without being processed by a Power+
+ server or a 3rd party</li>
+ <li>Grades are calculated on-device</li>
+ <li>Prefrences and grade history are stored on-device</li>
+ <li>Power+'s code is open-source and hosted directly from <a
+ href="https://github.com/jottocraft/dtps">GitHub</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <br /><br /><br /><br />
+ <div style="text-align: center; padding: 50px 0px;">
+ <img style="height: 45px; margin-right: 20px; vertical-align: middle;"
+ src="https://cdn.jottocraft.com/images/footerImage.png" />
+ <h5 style="display: inline-block; vertical-align: middle;">jottocraft</h5>
+ <p>(c) jottocraft 2018-2020. All rights reserved. <a href="https://github.com/jottocraft/dtps">source
+ code</a> <a href="https://github.com/jottocraft/dtps/blob/main/LICENSE">license</a></p>
+ </div>
+
+
+</body>
+
</html>
\ No newline at end of file