sources files

This commit is contained in:
luc lebosse
2017-05-19 14:18:02 +02:00
parent a780e99e57
commit cd3051a9b0
66 changed files with 12717 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
node_modules
dist
index2.html.gz

View File

@@ -52,6 +52,8 @@ Camera Tab:
<img src='https://raw.githubusercontent.com/luc-github/ESP3D-WEBUI/master/images/Camera.PNG'/>
Repetier EEPROM Editor tab:
<img src='https://raw.githubusercontent.com/luc-github/ESP3D-WEBUI/master/images/Repetier.PNG'/>
Smoothieware config Editor tab:
<img src='https://raw.githubusercontent.com/luc-github/ESP3D-WEBUI/master/images/smoothieware.PNG'/>
ESP3D settings Editor:
<img src='https://raw.githubusercontent.com/luc-github/ESP3D-WEBUI/master/images/ESP3D1.PNG'/>
ESP3D Status:

674
gpl.txt Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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 3 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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

149
gulpfile.js Normal file
View File

@@ -0,0 +1,149 @@
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
gulpif = require('gulp-if'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
cleanCSS = require('gulp-clean-css'),
removeCode = require('gulp-remove-code'),
merge = require('merge-stream'),
del = require('del'),
zip = require('gulp-zip'),
gzip = require('gulp-gzip'),
htmlmin = require('gulp-htmlmin'),
replace = require('gulp-replace'),
fs = require('fs'),
smoosher = require('gulp-smoosher');
var demoMode = false;
var testMode = false;
function clean() {
return del(['dist']);
}
function clean2() {
return del(['dist/js', 'dist/css']);
}
function lint() {
return gulp.src('www/js/**/app.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
}
function Copytest() {
return merge(
gulp.src(['www/index.html'])
.pipe(removeCode({production: false}))
.pipe(gulp.dest('dist')),
gulp.src(['www/images/**/*.*'])
.pipe(gulp.dest('dist/images'))
)
}
function Copy() {
return merge(
gulp.src(['www/index.html'])
.pipe(removeCode({production: true}))
.pipe(gulp.dest('dist')),
gulp.src(['www/images/**/*.*'])
.pipe(gulp.dest('dist/images'))
)
}
function concatApptest() {
return merge(
gulp.src([ 'www/js/**/*.js'])
.pipe(concat('app.js'))
.pipe(removeCode({production: false}))
.pipe(gulp.dest('./dist/js')),
gulp.src([ 'www/css/**/*.css'])
.pipe(concat('style.css'))
.pipe(gulp.dest('./dist/css/'))
)
}
function concatApp() {
return merge(
gulp.src([ 'www/js/**/*.js'])
.pipe(concat('app.js'))
.pipe(removeCode({production: true}))
.pipe(gulp.dest('./dist/js')),
gulp.src([ 'www/css/**/*.css'])
.pipe(concat('style.css'))
.pipe(gulp.dest('./dist/css/'))
)
}
function replaceSVG() {
return gulp.src('dist/index.html')
.pipe(replace(/<!-- replaceSVG -->(.*?)<!-- \/replaceSVG -->/g, function (match, p1) {
return fs.readFileSync('dist/images/jogdial.svg', 'utf8');
}))
.pipe(gulp.dest('dist'))
}
function minifyApp() {
return merge(
gulp.src(['dist/js/app.js'])
.pipe(uglify({mangle: true}))
.pipe(gulp.dest('./dist/js/')),
gulp.src('dist/css/style.css')
.pipe(cleanCSS({debug: true}, function(details) {
console.log(details.name + ': ' + details.stats.originalSize);
console.log(details.name + ': ' + details.stats.minifiedSize);
}))
.pipe(gulp.dest('./dist/css/')),
gulp.src('dist/index.html')
.pipe(htmlmin({collapseWhitespace: true, minifyCSS: true}))
.pipe(gulp.dest('dist'))
)
}
function includehtml() {
return merge(
gulp.src('dist/index.html')
.pipe(replace(/<file-include w3-include-html="'sub\/(.*?)'"><\/file-include>/g, function (match, p1) {
return fs.readFileSync('www/sub/' + p1, 'utf8');
}))
.pipe(gulp.dest('dist/'))
)
}
function smoosh() {
return gulp.src('dist/index.html')
.pipe(smoosher())
.pipe(gulp.dest('dist'))
}
function compress() {
return gulp.src('dist/index.html')
.pipe(gzip())
.pipe(gulp.dest('.'));
}
gulp.task(clean);
gulp.task(lint);
gulp.task(Copy);
gulp.task(Copytest);
gulp.task(replaceSVG);
gulp.task(concatApp);
gulp.task(concatApptest);
gulp.task(minifyApp);
gulp.task(smoosh);
gulp.task(clean2);
var defaultSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, includehtml, includehtml, smoosh);
//var packageSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, smoosh, compress);
var packageSeries = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, minifyApp, smoosh, compress, clean2);
var package2Series = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, smoosh);
var package2testSeries = gulp.series(clean, lint, Copy, concatApptest, includehtml, includehtml, replaceSVG, smoosh);
gulp.task('default', defaultSeries);
gulp.task('package', packageSeries);
gulp.task('package2', package2Series);
gulp.task('package2test', package2testSeries);

BIN
images/smoothieware.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
index.html.gz Normal file

Binary file not shown.

15
install.bat Normal file
View File

@@ -0,0 +1,15 @@
npm install --global gulp-cli
npm install --save-dev gulp
npm install --save-dev gulp-jshint
npm install --save-dev jshint
npm install --save-dev gulp-if
npm install --save-dev gulp-concat
npm install --save-dev gulp-uglify
npm install --save-dev gulp-clean-css
npm install --save-dev gulp-remove-code
npm install --save-dev del
npm install --save-dev gulp-zip
npm install --save-dev gulp-gzip
npm install --save-dev gulp-htmlmin
npm install --save-dev gulp-replace
npm install --save-dev gulp-smoosher

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "ESP3D-WebUI",
"description": "Web UI for ESP3D",
"devDependencies": {
"del": "^2.2.2",
"deprecated": "0.0.1",
"fs": "0.0.1-security",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-bytediff": "^1.0.0",
"gulp-cdnizer": "^1.1.7",
"gulp-clean-css": "^2.4.0",
"gulp-concat": "^2.6.1",
"gulp-gzip": "^1.4.0",
"gulp-htmlmin": "^3.0.0",
"gulp-if": "^2.0.2",
"gulp-jshint": "^2.0.4",
"gulp-ng-annotate": "^2.0.0",
"gulp-remove-code": "^1.0.2",
"gulp-replace": "^0.5.4",
"gulp-smoosher": "0.0.9",
"gulp-uglify": "^2.1.2",
"gulp-util": "^3.0.1",
"gulp-zip": "^3.2.0",
"jshint": "^2.9.4",
"merge-stream": "^1.0.1"
},
"repository": "https://github.com/luc-github/ESP3D-WEBUI",
"author": "Luc LEBOSSE",
"license": "(ISC OR GPL-3.0)"
}

5042
www/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

415
www/css/config.json Normal file
View File

@@ -0,0 +1,415 @@
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
"@brand-warning": "#f0ad4e",
"@brand-danger": "#d9534f",
"@body-bg": "#fff",
"@text-color": "@gray-dark",
"@link-color": "@brand-primary",
"@link-hover-color": "darken(@link-color, 15%)",
"@link-hover-decoration": "underline",
"@font-family-sans-serif": "\"Helvetica Neue\", Helvetica, Arial, sans-serif",
"@font-family-serif": "Georgia, \"Times New Roman\", Times, serif",
"@font-family-monospace": "Menlo, Monaco, Consolas, \"Courier New\", monospace",
"@font-family-base": "@font-family-sans-serif",
"@font-size-base": "14px",
"@font-size-large": "ceil((@font-size-base * 1.25))",
"@font-size-small": "ceil((@font-size-base * 0.85))",
"@font-size-h1": "floor((@font-size-base * 2.6))",
"@font-size-h2": "floor((@font-size-base * 2.15))",
"@font-size-h3": "ceil((@font-size-base * 1.7))",
"@font-size-h4": "ceil((@font-size-base * 1.25))",
"@font-size-h5": "@font-size-base",
"@font-size-h6": "ceil((@font-size-base * 0.85))",
"@line-height-base": "1.428571429",
"@line-height-computed": "floor((@font-size-base * @line-height-base))",
"@headings-font-family": "inherit",
"@headings-font-weight": "500",
"@headings-line-height": "1.1",
"@headings-color": "inherit",
"@icon-font-path": "\"../fonts/\"",
"@icon-font-name": "\"glyphicons-halflings-regular\"",
"@icon-font-svg-id": "\"glyphicons_halflingsregular\"",
"@padding-base-vertical": "6px",
"@padding-base-horizontal": "12px",
"@padding-large-vertical": "10px",
"@padding-large-horizontal": "16px",
"@padding-small-vertical": "5px",
"@padding-small-horizontal": "10px",
"@padding-xs-vertical": "1px",
"@padding-xs-horizontal": "5px",
"@line-height-large": "1.3333333",
"@line-height-small": "1.5",
"@border-radius-base": "4px",
"@border-radius-large": "6px",
"@border-radius-small": "3px",
"@component-active-color": "#fff",
"@component-active-bg": "@brand-primary",
"@caret-width-base": "4px",
"@caret-width-large": "5px",
"@table-cell-padding": "8px",
"@table-condensed-cell-padding": "5px",
"@table-bg": "transparent",
"@table-bg-accent": "#f9f9f9",
"@table-bg-hover": "#f5f5f5",
"@table-bg-active": "@table-bg-hover",
"@table-border-color": "#ddd",
"@btn-font-weight": "normal",
"@btn-default-color": "#333",
"@btn-default-bg": "#fff",
"@btn-default-border": "#ccc",
"@btn-primary-color": "#fff",
"@btn-primary-bg": "@brand-primary",
"@btn-primary-border": "darken(@btn-primary-bg, 5%)",
"@btn-success-color": "#fff",
"@btn-success-bg": "@brand-success",
"@btn-success-border": "darken(@btn-success-bg, 5%)",
"@btn-info-color": "#fff",
"@btn-info-bg": "@brand-info",
"@btn-info-border": "darken(@btn-info-bg, 5%)",
"@btn-warning-color": "#fff",
"@btn-warning-bg": "@brand-warning",
"@btn-warning-border": "darken(@btn-warning-bg, 5%)",
"@btn-danger-color": "#fff",
"@btn-danger-bg": "@brand-danger",
"@btn-danger-border": "darken(@btn-danger-bg, 5%)",
"@btn-link-disabled-color": "@gray-light",
"@btn-border-radius-base": "@border-radius-base",
"@btn-border-radius-large": "@border-radius-large",
"@btn-border-radius-small": "@border-radius-small",
"@input-bg": "#fff",
"@input-bg-disabled": "@gray-lighter",
"@input-color": "@gray",
"@input-border": "#ccc",
"@input-border-radius": "@border-radius-base",
"@input-border-radius-large": "@border-radius-large",
"@input-border-radius-small": "@border-radius-small",
"@input-border-focus": "#66afe9",
"@input-color-placeholder": "#999",
"@input-height-base": "(@line-height-computed + (@padding-base-vertical * 2) + 2)",
"@input-height-large": "(ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2)",
"@input-height-small": "(floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2)",
"@form-group-margin-bottom": "15px",
"@legend-color": "@gray-dark",
"@legend-border-color": "#e5e5e5",
"@input-group-addon-bg": "@gray-lighter",
"@input-group-addon-border-color": "@input-border",
"@cursor-disabled": "not-allowed",
"@dropdown-bg": "#fff",
"@dropdown-border": "rgba(0,0,0,.15)",
"@dropdown-fallback-border": "#ccc",
"@dropdown-divider-bg": "#e5e5e5",
"@dropdown-link-color": "@gray-dark",
"@dropdown-link-hover-color": "darken(@gray-dark, 5%)",
"@dropdown-link-hover-bg": "#f5f5f5",
"@dropdown-link-active-color": "@component-active-color",
"@dropdown-link-active-bg": "@component-active-bg",
"@dropdown-link-disabled-color": "@gray-light",
"@dropdown-header-color": "@gray-light",
"@dropdown-caret-color": "#000",
"@screen-xs": "480px",
"@screen-xs-min": "@screen-xs",
"@screen-phone": "@screen-xs-min",
"@screen-sm": "768px",
"@screen-sm-min": "@screen-sm",
"@screen-tablet": "@screen-sm-min",
"@screen-md": "992px",
"@screen-md-min": "@screen-md",
"@screen-desktop": "@screen-md-min",
"@screen-lg": "1200px",
"@screen-lg-min": "@screen-lg",
"@screen-lg-desktop": "@screen-lg-min",
"@screen-xs-max": "(@screen-sm-min - 1)",
"@screen-sm-max": "(@screen-md-min - 1)",
"@screen-md-max": "(@screen-lg-min - 1)",
"@grid-columns": "12",
"@grid-gutter-width": "30px",
"@grid-float-breakpoint": "@screen-sm-min",
"@grid-float-breakpoint-max": "(@grid-float-breakpoint - 1)",
"@container-tablet": "(720px + @grid-gutter-width)",
"@container-sm": "@container-tablet",
"@container-desktop": "(940px + @grid-gutter-width)",
"@container-md": "@container-desktop",
"@container-large-desktop": "(1140px + @grid-gutter-width)",
"@container-lg": "@container-large-desktop",
"@navbar-height": "50px",
"@navbar-margin-bottom": "@line-height-computed",
"@navbar-border-radius": "@border-radius-base",
"@navbar-padding-horizontal": "floor((@grid-gutter-width / 2))",
"@navbar-padding-vertical": "((@navbar-height - @line-height-computed) / 2)",
"@navbar-collapse-max-height": "340px",
"@navbar-default-color": "#777",
"@navbar-default-bg": "#f8f8f8",
"@navbar-default-border": "darken(@navbar-default-bg, 6.5%)",
"@navbar-default-link-color": "#777",
"@navbar-default-link-hover-color": "#333",
"@navbar-default-link-hover-bg": "transparent",
"@navbar-default-link-active-color": "#555",
"@navbar-default-link-active-bg": "darken(@navbar-default-bg, 6.5%)",
"@navbar-default-link-disabled-color": "#ccc",
"@navbar-default-link-disabled-bg": "transparent",
"@navbar-default-brand-color": "@navbar-default-link-color",
"@navbar-default-brand-hover-color": "darken(@navbar-default-brand-color, 10%)",
"@navbar-default-brand-hover-bg": "transparent",
"@navbar-default-toggle-hover-bg": "#ddd",
"@navbar-default-toggle-icon-bar-bg": "#888",
"@navbar-default-toggle-border-color": "#ddd",
"@navbar-inverse-color": "lighten(@gray-light, 15%)",
"@navbar-inverse-bg": "#222",
"@navbar-inverse-border": "darken(@navbar-inverse-bg, 10%)",
"@navbar-inverse-link-color": "lighten(@gray-light, 15%)",
"@navbar-inverse-link-hover-color": "#fff",
"@navbar-inverse-link-hover-bg": "transparent",
"@navbar-inverse-link-active-color": "@navbar-inverse-link-hover-color",
"@navbar-inverse-link-active-bg": "darken(@navbar-inverse-bg, 10%)",
"@navbar-inverse-link-disabled-color": "#444",
"@navbar-inverse-link-disabled-bg": "transparent",
"@navbar-inverse-brand-color": "@navbar-inverse-link-color",
"@navbar-inverse-brand-hover-color": "#fff",
"@navbar-inverse-brand-hover-bg": "transparent",
"@navbar-inverse-toggle-hover-bg": "#333",
"@navbar-inverse-toggle-icon-bar-bg": "#fff",
"@navbar-inverse-toggle-border-color": "#333",
"@nav-link-padding": "10px 15px",
"@nav-link-hover-bg": "@gray-lighter",
"@nav-disabled-link-color": "@gray-light",
"@nav-disabled-link-hover-color": "@gray-light",
"@nav-tabs-border-color": "#ddd",
"@nav-tabs-link-hover-border-color": "@gray-lighter",
"@nav-tabs-active-link-hover-bg": "@body-bg",
"@nav-tabs-active-link-hover-color": "@gray",
"@nav-tabs-active-link-hover-border-color": "#ddd",
"@nav-tabs-justified-link-border-color": "#ddd",
"@nav-tabs-justified-active-link-border-color": "@body-bg",
"@nav-pills-border-radius": "@border-radius-base",
"@nav-pills-active-link-hover-bg": "@component-active-bg",
"@nav-pills-active-link-hover-color": "@component-active-color",
"@pagination-color": "@link-color",
"@pagination-bg": "#fff",
"@pagination-border": "#ddd",
"@pagination-hover-color": "@link-hover-color",
"@pagination-hover-bg": "@gray-lighter",
"@pagination-hover-border": "#ddd",
"@pagination-active-color": "#fff",
"@pagination-active-bg": "@brand-primary",
"@pagination-active-border": "@brand-primary",
"@pagination-disabled-color": "@gray-light",
"@pagination-disabled-bg": "#fff",
"@pagination-disabled-border": "#ddd",
"@pager-bg": "@pagination-bg",
"@pager-border": "@pagination-border",
"@pager-border-radius": "15px",
"@pager-hover-bg": "@pagination-hover-bg",
"@pager-active-bg": "@pagination-active-bg",
"@pager-active-color": "@pagination-active-color",
"@pager-disabled-color": "@pagination-disabled-color",
"@jumbotron-padding": "30px",
"@jumbotron-color": "inherit",
"@jumbotron-bg": "@gray-lighter",
"@jumbotron-heading-color": "inherit",
"@jumbotron-font-size": "ceil((@font-size-base * 1.5))",
"@jumbotron-heading-font-size": "ceil((@font-size-base * 4.5))",
"@state-success-text": "#3c763d",
"@state-success-bg": "#dff0d8",
"@state-success-border": "darken(spin(@state-success-bg, -10), 5%)",
"@state-info-text": "#31708f",
"@state-info-bg": "#d9edf7",
"@state-info-border": "darken(spin(@state-info-bg, -10), 7%)",
"@state-warning-text": "#8a6d3b",
"@state-warning-bg": "#fcf8e3",
"@state-warning-border": "darken(spin(@state-warning-bg, -10), 5%)",
"@state-danger-text": "#a94442",
"@state-danger-bg": "#f2dede",
"@state-danger-border": "darken(spin(@state-danger-bg, -10), 5%)",
"@tooltip-max-width": "200px",
"@tooltip-color": "#fff",
"@tooltip-bg": "#000",
"@tooltip-opacity": ".9",
"@tooltip-arrow-width": "5px",
"@tooltip-arrow-color": "@tooltip-bg",
"@popover-bg": "#fff",
"@popover-max-width": "276px",
"@popover-border-color": "rgba(0,0,0,.2)",
"@popover-fallback-border-color": "#ccc",
"@popover-title-bg": "darken(@popover-bg, 3%)",
"@popover-arrow-width": "10px",
"@popover-arrow-color": "@popover-bg",
"@popover-arrow-outer-width": "(@popover-arrow-width + 1)",
"@popover-arrow-outer-color": "fadein(@popover-border-color, 5%)",
"@popover-arrow-outer-fallback-color": "darken(@popover-fallback-border-color, 20%)",
"@label-default-bg": "@gray-light",
"@label-primary-bg": "@brand-primary",
"@label-success-bg": "@brand-success",
"@label-info-bg": "@brand-info",
"@label-warning-bg": "@brand-warning",
"@label-danger-bg": "@brand-danger",
"@label-color": "#fff",
"@label-link-hover-color": "#fff",
"@modal-inner-padding": "15px",
"@modal-title-padding": "15px",
"@modal-title-line-height": "@line-height-base",
"@modal-content-bg": "#fff",
"@modal-content-border-color": "rgba(0,0,0,.2)",
"@modal-content-fallback-border-color": "#999",
"@modal-backdrop-bg": "#000",
"@modal-backdrop-opacity": ".5",
"@modal-header-border-color": "#e5e5e5",
"@modal-footer-border-color": "@modal-header-border-color",
"@modal-lg": "900px",
"@modal-md": "600px",
"@modal-sm": "300px",
"@alert-padding": "15px",
"@alert-border-radius": "@border-radius-base",
"@alert-link-font-weight": "bold",
"@alert-success-bg": "@state-success-bg",
"@alert-success-text": "@state-success-text",
"@alert-success-border": "@state-success-border",
"@alert-info-bg": "@state-info-bg",
"@alert-info-text": "@state-info-text",
"@alert-info-border": "@state-info-border",
"@alert-warning-bg": "@state-warning-bg",
"@alert-warning-text": "@state-warning-text",
"@alert-warning-border": "@state-warning-border",
"@alert-danger-bg": "@state-danger-bg",
"@alert-danger-text": "@state-danger-text",
"@alert-danger-border": "@state-danger-border",
"@progress-bg": "#f5f5f5",
"@progress-bar-color": "#fff",
"@progress-border-radius": "@border-radius-base",
"@progress-bar-bg": "@brand-primary",
"@progress-bar-success-bg": "@brand-success",
"@progress-bar-warning-bg": "@brand-warning",
"@progress-bar-danger-bg": "@brand-danger",
"@progress-bar-info-bg": "@brand-info",
"@list-group-bg": "#fff",
"@list-group-border": "#ddd",
"@list-group-border-radius": "@border-radius-base",
"@list-group-hover-bg": "#f5f5f5",
"@list-group-active-color": "@component-active-color",
"@list-group-active-bg": "@component-active-bg",
"@list-group-active-border": "@list-group-active-bg",
"@list-group-active-text-color": "lighten(@list-group-active-bg, 40%)",
"@list-group-disabled-color": "@gray-light",
"@list-group-disabled-bg": "@gray-lighter",
"@list-group-disabled-text-color": "@list-group-disabled-color",
"@list-group-link-color": "#555",
"@list-group-link-hover-color": "@list-group-link-color",
"@list-group-link-heading-color": "#333",
"@panel-bg": "#fff",
"@panel-body-padding": "15px",
"@panel-heading-padding": "10px 15px",
"@panel-footer-padding": "@panel-heading-padding",
"@panel-border-radius": "@border-radius-base",
"@panel-inner-border": "#ddd",
"@panel-footer-bg": "#f5f5f5",
"@panel-default-text": "@gray-dark",
"@panel-default-border": "#ddd",
"@panel-default-heading-bg": "#f5f5f5",
"@panel-primary-text": "#fff",
"@panel-primary-border": "@brand-primary",
"@panel-primary-heading-bg": "@brand-primary",
"@panel-success-text": "@state-success-text",
"@panel-success-border": "@state-success-border",
"@panel-success-heading-bg": "@state-success-bg",
"@panel-info-text": "@state-info-text",
"@panel-info-border": "@state-info-border",
"@panel-info-heading-bg": "@state-info-bg",
"@panel-warning-text": "@state-warning-text",
"@panel-warning-border": "@state-warning-border",
"@panel-warning-heading-bg": "@state-warning-bg",
"@panel-danger-text": "@state-danger-text",
"@panel-danger-border": "@state-danger-border",
"@panel-danger-heading-bg": "@state-danger-bg",
"@thumbnail-padding": "4px",
"@thumbnail-bg": "@body-bg",
"@thumbnail-border": "#ddd",
"@thumbnail-border-radius": "@border-radius-base",
"@thumbnail-caption-color": "@text-color",
"@thumbnail-caption-padding": "9px",
"@well-bg": "#f5f5f5",
"@well-border": "darken(@well-bg, 7%)",
"@badge-color": "#fff",
"@badge-link-hover-color": "#fff",
"@badge-bg": "@gray-light",
"@badge-active-color": "@link-color",
"@badge-active-bg": "#fff",
"@badge-font-weight": "bold",
"@badge-line-height": "1",
"@badge-border-radius": "10px",
"@breadcrumb-padding-vertical": "8px",
"@breadcrumb-padding-horizontal": "15px",
"@breadcrumb-bg": "#f5f5f5",
"@breadcrumb-color": "#ccc",
"@breadcrumb-active-color": "@gray-light",
"@breadcrumb-separator": "\"/\"",
"@carousel-text-shadow": "0 1px 2px rgba(0,0,0,.6)",
"@carousel-control-color": "#fff",
"@carousel-control-width": "15%",
"@carousel-control-opacity": ".5",
"@carousel-control-font-size": "20px",
"@carousel-indicator-active-bg": "#fff",
"@carousel-indicator-border-color": "#fff",
"@carousel-caption-color": "#fff",
"@close-font-weight": "bold",
"@close-color": "#000",
"@close-text-shadow": "0 1px 0 #fff",
"@code-color": "#c7254e",
"@code-bg": "#f9f2f4",
"@kbd-color": "#fff",
"@kbd-bg": "#333",
"@pre-bg": "#f5f5f5",
"@pre-color": "@gray-dark",
"@pre-border-color": "#ccc",
"@pre-scrollable-max-height": "340px",
"@component-offset-horizontal": "180px",
"@text-muted": "@gray-light",
"@abbr-border-color": "@gray-light",
"@headings-small-color": "@gray-light",
"@blockquote-small-color": "@gray-light",
"@blockquote-font-size": "(@font-size-base * 1.25)",
"@blockquote-border-color": "@gray-lighter",
"@page-header-border-color": "@gray-lighter",
"@dl-horizontal-offset": "@component-offset-horizontal",
"@dl-horizontal-breakpoint": "@grid-float-breakpoint",
"@hr-border": "@gray-lighter"
},
"css": [
"print.less",
"type.less",
"code.less",
"grid.less",
"tables.less",
"forms.less",
"buttons.less",
"responsive-utilities.less",
"button-groups.less",
"input-groups.less",
"navs.less",
"navbar.less",
"pagination.less",
"pager.less",
"labels.less",
"badges.less",
"alerts.less",
"progress-bars.less",
"media.less",
"list-group.less",
"panels.less",
"responsive-embed.less",
"component-animations.less",
"dropdowns.less",
"tooltip.less",
"popovers.less",
"modals.less"
],
"js": [],
"customizerUrl": "http://getbootstrap.com/customize/?id=4c7131e1a6b32f2835aea278b14c209d"
}

86
www/css/menu.css Normal file
View File

@@ -0,0 +1,86 @@
.dropbtn {
padding: 16px;
font-size: 14px;
border: none;
cursor: pointer;
}
.dropdown {
position: relative;
display: inline-block;
border-color: #000000;
}
.dropdownselect {
position: relative;
display: inline-block;
border-color: #000000;
}
.dropmenu-content,
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
border:1px solid #dddddd;
padding-top: 4px;
padding-bottom: 4px;
}
.dropmenu-content a,
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropmenu-content a:hover,
.dropdown-content a:hover {background-color: #e1e1e1}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #e1e1e1;
}
.menu-title {
padding: 5px 10px;
font-size: 12px;
}
.menu-divider {
height: 1px;
margin: 2px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropmenu-content-up {
bottom: 3em;
left: 0em
}
.dropmenu-content-down {
top: 3em;
left: 0em
}
@media (min-width: 768px) {
.dropdown-content {
top: 3em;
right: 1em;
}
}
@media screen and (max-width: 767px) {
.dropdown-content {
top: 3em;
left: 1.2em;
}
}

108
www/css/modaldlg.css Normal file
View File

@@ -0,0 +1,108 @@
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 10000; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
-webkit-animation-name: fadeIn; /* Fade in the background */
-webkit-animation-duration: 0.4s;
animation-name: fadeIn;
animation-duration: 0.4s;
}
.topmodal {
z-index: 20000 ! important; /* Sit on top of the top */
}
/* Modal Content */
.modal-content {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
border: 2px solid #337AB7;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
position: relative;
margin: auto;
padding: 0;
background-color: #fefefe;
-webkit-animation-name: slideIn;
-webkit-animation-duration: 0.4s;
animation-name: slideIn;
animation-duration: 0.4s
}
/* The Close Button */
.close {
color: #000;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #337AB7;
text-decoration: none;
cursor: pointer;
}
.modal-header {
padding: 2px 16px;
color: #0f0f0f;
background-color: #f2f2f2;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: 1px solid #cfcfcf;
}
.modal-body {padding: 10px 16px;}
.modal-footer {
padding: 16px 16px;
height: 4.5em;
color: #0f0f0f;
background-color: #f2f2f2;
border-top: 1px solid #cfcfcf;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
/* Add Animation */
@-webkit-keyframes slideIn {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
@keyframes slideIn {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
@-webkit-keyframes fadeIn {
from {opacity: 0}
to {opacity: 1}
}
@keyframes fadeIn {
from {opacity: 0}
to {opacity: 1}
}
@media (min-width: 768px) {
.modal-content {
width: 580px;
}
}
@media screen and (max-width: 767px) {
.modal-content {
width: 100%;
}
}

135
www/css/style.css Normal file
View File

@@ -0,0 +1,135 @@
body {
font-family: "Arial", sans-serif;
font-size:14px;}
.hide_it {
display: none;
}
.warningmsg {
color:white;
}
.warningmsg:hover {
color:red;
}
.no_margin {
margin: 0 !important;
line-height: 0;
}
.loader {
border: 4px solid #f3f3f3; /* Light grey */
border-top: 4px solid #3498db; /* Blue */
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 2s linear infinite;
}
@-webkit-keyframes pulse {
50% {
background: red;
}
}
@keyframes pulse {
50% {
background: red;
}
}
.loader-pulse {
position: relative;
width: 0.25em;
height: 1em;
background: rgba(255, 0, 0, 0.2);
-webkit-animation: pulse 750ms infinite;
animation: pulse 750ms infinite;
-webkit-animation-delay: 250ms;
animation-delay: 250ms;
}
.loader-pulse:before, .loader-pulse:after {
content: '';
position: absolute;
display: block;
height: 0.66em;
width: 0.25em;
background: rgba(255, 0, 0, 0.2);
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-animation: pulse 750ms infinite;
animation: pulse 750ms infinite;
}
.loader-pulse:before {
left: -0.5em;
}
.loader-pulse:after {
left: 0.5em;
-webkit-animation-delay: 500ms;
animation-delay: 500ms;
}
.panel-height {
min-height: 370px;
}
.panel-max-height{
max-height: 370px;
}
.panel-height-temp {
min-height: 405px;
}
.panel-footer-height {
min-height:4em;
}
.panel-scroll {
overflow-y: scroll;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-webkit-keyframes pulse {
50% {
background: red;
}
}
@keyframes pulse {
50% {
background: red;
}
}
.list-group-hover:hover {
background-color: #f5f5f5;
}
.table-borderless tbody tr td,
.table-borderless tbody tr th,
.table-borderless thead tr td,
.table-borderless thead tr th,
.table-borderless tfoot tr th,
.table-borderless tfoot tr td {
border: none;
}
input[type="file"]::-webkit-file-upload-button{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #5bc0de;border-color: #46b8da;}
input[type="file"]::-webkit-file-upload-button:focus{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #31b0d5;border-color: #1b6d85;}
input[type="file"]::-webkit-file-upload-button:hover{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; color: #ffffff;background-color: #31b0d5;border-color: #269abc;}
.panel-footer1{padding:10px 15px;color:#31708f;background-color:#f5f5f5;border-color:#dddddd;border-top:1px solid #dddddd;}

59
www/css/tabs.css Normal file
View File

@@ -0,0 +1,59 @@
/* Style the tab */
div.tab {
overflow: hidden;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-color: #f1f1f1;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
/* Style the buttons inside the tab */
div.tab button {
background-color: inherit;
float: left;
border-top: 1px solid #f1f1f1;
border-bottom: 1px solid #f1f1f1;
border-left: 1px solid #f1f1f1;
border-right: 1px solid #f1f1f1;
outline: none;
cursor: pointer;
padding: 12px 14px;
transition: 0.3s;
color:#337AB7;
}
/* Change background color of buttons on hover */
div.tab button:hover {
background-color: #ddd;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
}
/* Create an active/current tablink class */
div.tab button.active {
background-color: #ffffff;
border-top: 1px solid #ccc;
border-bottom: 1px solid #fff;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
color:#555555;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
}

226
www/index.html Normal file
View File

@@ -0,0 +1,226 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ESP3D WebUI</title>
<script>var target_firmware="";</script>
<script>var web_ui_version="0.9.1";</script>
<script>var direct_sd=false;</script>
<script>var fw_version="";</script>
<script>var primary_sd= "/ext/";</script>
<script>var secondary_sd= "/sd/";</script>
<!--removeIf(production)-->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/menu.css" rel="stylesheet">
<link href="css/tabs.css" rel="stylesheet">
<link href="css/modaldlg.css" rel="stylesheet">
<!--endRemoveIf(production)-->
<!-- smoosh -->
<link href="css/style.css" rel="stylesheet">
<!-- endsmoosh -->
</head>
<body>
<div id='warningmsg' class='warningmsg' >Checking Javascript is enabled....<br> if this is the only thing you see you may need to enable Javascript in your browser.</div>
<div id="main_ui" class="container-fluid hide_it">
<!-- topnavbar -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0; padding-right:2em;" >
<div class="navbar-header">
<span class="navbar-brand">
<span translate>ESP3D for</span>
<span id='fwName'>&nbsp;</span>
<span id='showSDused'>&nbsp;</span>
</span>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#">
<i class="dropbtn">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='#337AB7' d='M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM675 1000h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5 t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5zM675 700h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h75v-200h-75q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h350q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5 t-17.5 7.5h-75v275q0 10 -7.5 17.5t-17.5 7.5z' />
</g>
</svg>
</i>
</a>
<div class="dropdown-content">
<div class="menu-title">
<center>
<span >UI: </span>
<span id='UI_VERSION' ></span>
<span > / FW: </span>
<span id='FW_VERSION' ></span>
</center>
</div>
<div class="menu-divider"></div>
<a href="https://github.com/luc-github/ESP3D" >
<span class="pull-right" translate>Firmware</span>
<span class="pull-left">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path d='M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z' />
</g>
</svg>
</span>
<span class="clearfix"></span>
</a>
<a href="https://github.com/luc-github/ESP3D-webui" >
<span class="pull-right" translate>Interface</span>
<span class="pull-left">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path d='M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z' />
</g>
</svg>
</span>
<span class="clearfix"></span>
</a>
<div class="menu-divider"></div>
<a href="#" onclick='creditsdlg()'>
<span class="pull-right" translate>Credits</span>
<span class="pull-left">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path d='M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z' />
</g>
</svg>
</span>
<span class="clearfix"></span>
</a>
</div>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#">
<span class="dropbtn text-info" id="translate_menu">English</span>
</a>
<div class="dropdown-content" id="lang_menu">
<a href="#" onclick="translate_text('en');">
<span >English</span>
<span class="clearfix"></span>
</a>
<a href="#" onclick="translate_text('sp');">
<span >Espa&ntilde;ol</span>
<span class="clearfix"></span>
</a>
<a href="#" onclick="translate_text('fr');">
<span >Fran&ccedil;ais</span>
<span class="clearfix"></span>
</a>
</div>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" onclick="OnCheckCam()">
<i class="dropbtn">
<input type="checkbox" id="camcheck" >
<i >
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z' />
</g>
</svg>
</i>
</I>
</a>
</li>
</ul>
</nav>
<!-- /topnavbar -->
<!-- tabbar -->
<div class="tab">
<button class="tablinks" onclick="opentab(event, 'maintab')" id="maintablink">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M100 1196h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 1096h-200v-100h200v100zM100 796h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 696h-500v-100h500v100zM100 396h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 296h-300v-100h300v100z ' />
</g>
</svg>
<span translate>Dashboard</span>
</button>
<button class="tablinks hide_it" onclick="opentab(event, 'cameratab')" id="camtablink">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z' />
</g>
</svg>
<span translate>Camera</span>
</button>
<button class="tablinks hide_it" onclick="opentab(event, 'configtab')" id="configtablink">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M756 1157q164 92 306 -9l-259 -138l145 -232l251 126q6 -89 -34 -156.5t-117 -110.5q-60 -34 -127 -39.5t-126 16.5l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5t15 37.5l600 599q-34 101 5.5 201.5t135.5 154.5z' />
</g>
</svg>
<span translate>Printer</span>
</button>
<button class="tablinks" onclick="opentab(event, 'settingstab')" id="settingtablink">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M212 1198h780q86 0 147 -61t61 -147v-416q0 -51 -18 -142.5t-36 -157.5l-18 -66q-29 -87 -93.5 -146.5t-146.5 -59.5h-572q-82 0 -147 59t-93 147q-8 28 -20 73t-32 143.5t-20 149.5v416q0 86 61 147t147 61zM600 1045q-70 0 -132.5 -11.5t-105.5 -30.5t-78.5 -41.5 t-57 -45t-36 -41t-20.5 -30.5l-6 -12l156 -243h560l156 243q-2 5 -6 12.5t-20 29.5t-36.5 42t-57 44.5t-79 42t-105 29.5t-132.5 12zM762 703h-157l195 261z' />
</g>
</svg>
<span translate>ESP3D</span>
</button>
</div>
<!-- / tabbar -->
<!-- content -->
<file-include w3-include-html="'sub/dashtab.html'"></file-include>
<file-include w3-include-html="'sub/cameratab.html'"></file-include>
<file-include w3-include-html="'sub/configtab.html'"></file-include>
<file-include w3-include-html="'sub/settingstab.html'"></file-include>
<!-- / content -->
</div>
<!-- template -->
<file-include w3-include-html="'sub/connectdlg.html'"></file-include>
<file-include w3-include-html="'sub/alertdlg.html'"></file-include>
<file-include w3-include-html="'sub/confirmdlg.html'"></file-include>
<file-include w3-include-html="'sub/inputdlg.html'"></file-include>
<file-include w3-include-html="'sub/creditsdlg.html'"></file-include>
<file-include w3-include-html="'sub/scanwifidlg.html'"></file-include>
<file-include w3-include-html="'sub/SPIFFSdlg.html'"></file-include>
<file-include w3-include-html="'sub/statusdlg.html'"></file-include>
<file-include w3-include-html="'sub/updatedlg.html'"></file-include>
<file-include w3-include-html="'sub/setupdlg.html'"></file-include>
<file-include w3-include-html="'sub/macrodlg.html'"></file-include>
<file-include w3-include-html="'sub/restartdlg.html'"></file-include>
<!-- / template -->
<!--removeIf(production)-->
<script src="js/http.js"></script>
<script src="js/icons.js"></script>
<script src="js/camera.js"></script>
<script src="js/settings.js"></script>
<script src="js/config.js"></script>
<script src="js/tabs.js"></script>
<script src="js/alertdlg.js"></script>
<script src="js/confirmdlg.js"></script>
<script src="js/inputdlg.js"></script>
<script src="js/creditsdlg.js"></script>
<script src="js/scanwifidlg.js"></script>
<script src="js/connectdlg.js"></script>
<script src="js/restartdlg.js"></script>
<script src="js/modaldlg.js"></script>
<script src="js/SPIFFSdlg.js"></script>
<script src="js/statusdlg.js"></script>
<script src="js/updatedlg.js"></script>
<script src="js/setupdlg.js"></script>
<script src="js/macrodlg.js"></script>
<script src="js/translate.js"></script>
<script src="js/commands.js"></script>
<script src="js/extruders.js"></script>
<script src="js/printercmd.js"></script>
<script src="js/temperatures.js"></script>
<script src="js/controls.js"></script>
<script src="js/smoothie.js"></script>
<script src="js/dropmenu.js"></script>
<script src="js/localstorage.js"></script>
<!--endRemoveIf(production)-->
<!-- smoosh -->
<script src="js/app.js"></script>
<!-- endsmoosh -->
</body>
</html>

230
www/js/SPIFFSdlg.js Normal file
View File

@@ -0,0 +1,230 @@
//SPIFFS dialog
var SPIFFS_currentpath = "/";
var SPIFFS_currentfile = "";
var SPIFFS_upload_ongoing=false;
function SPIFFSdlg (root) {
var modal = setactiveModal('SPIFFSdlg.html');
if ( modal == null) return;
if (typeof root !== 'undefined')SPIFFS_currentpath = root;
document.getElementById("SPIFFS-select").value="";
document.getElementById("SPIFFS_uploadbtn").style.display='none';
document.getElementById("SPIFFS_prg").style.display='none';
document.getElementById("uploadSPIFFSmsg").style.display='none';
showModal() ;
refreshSPIFFS();
}
function closeSPIFFSDialog(msg){
if (SPIFFS_upload_ongoing) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Upload is ongoing, please wait and retry."));
return;
}
closeModal(msg);
}
function SPIFFSnavbar(){
var content="<table><tr>";
var tlist = SPIFFS_currentpath.split("/");
var path="/";
var nb = 1;
content+="<td><button class='btn btn-primary' onclick=\"SPIFFS_currentpath='/'; SPIFFSSendCommand('list','all');\">/</button></td>";
while (nb < (tlist.length-1))
{
path+=tlist[nb] + "/";
content+="<td><button class='btn btn-link' onclick=\"SPIFFS_currentpath='"+path+"'; SPIFFSSendCommand('list','all');\">"+tlist[nb] +"</button></td><td>/</td>";
nb++;
}
content+="</tr></table>";
return content;
}
function SPIFFSselect_dir(directoryname){
SPIFFS_currentpath+=directoryname + "/";
SPIFFSSendCommand('list','all');
}
function SPIFFS_Createdir(){
inputdlg(translate_text_item("Please enter directory name"), translate_text_item("Name:"), processSPIFFS_Createdir);
}
function processSPIFFS_Createdir(answer){
if (answer.length > 0) SPIFFSSendCommand("createdir",answer.trim());
}
function SPIFFSDelete(filename){
SPIFFS_currentfile = filename;
confirmdlg(translate_text_item("Please Confirm"), translate_text_item("Confirm deletion of file: " )+ filename, processSPIFFSDelete);
}
function processSPIFFSDelete(answer){
if (answer == "yes")SPIFFSSendCommand("delete",SPIFFS_currentfile);
SPIFFS_currentfile = "";
}
function SPIFFSDeletedir(filename){
SPIFFS_currentfile = filename;
confirmdlg(translate_text_item("Please Confirm"), translate_text_item("Confirm deletion of directory: ") + filename, processSPIFFSDelete);
}
function processSPIFFSDelete(answer){
if (answer == "yes")SPIFFSSendCommand("deletedir",SPIFFS_currentfile);
SPIFFS_currentfile = "";
}
function SPIFFSSendCommand(action,filename){
//removeIf(production)
var response = "{\"files\":[{\"name\":\"config.html.gz\",\"size\":\"4.76 KB\"},{\"name\":\"index.html.gz\",\"size\":\"21.44 KB\"},{\"name\":\"favicon.ico\",\"size\":\"1.12 KB\"},{\"name\":\"config.htm\",\"size\":\"19.65 KB\"},{\"name\":\"config2.htm\",\"size\":\"19.98 KB\"},{\"name\":\"Testname\",\"size\":\"-1\"},{\"name\":\"index2.html.gz\",\"size\":\"28.89 KB\"}],\"path\":\"/\",\"status\":\"Ok\",\"total\":\"2.81 MB\",\"used\":\"118.88 KB\",\"occupation\":\"4\"}";
SPIFFSsuccess(response);
return;
//endRemoveIf(production)
var url = "/files?action="+action;
url += "&filename="+encodeURI(filename);
url += "&path="+encodeURI(SPIFFS_currentpath);
document.getElementById('SPIFFS_loader').style.visibility="visible";
SendGetHttp(url, SPIFFSsuccess, SPIFFSfailed)
}
function SPIFFSsuccess(response){
//console.log(response);
var jsonresponse = JSON.parse(response);
document.getElementById('SPIFFS_loader').style.visibility="hidden";
document.getElementById('refreshSPIFFSbtn').style.display='block';
SPIFFSdispatchfilestatus(jsonresponse);
}
function SPIFFSfailed(errorcode, response){
document.getElementById('SPIFFS_loader').style.visibility="hidden";
document.getElementById('refreshSPIFFSbtn').style.display='block';
alertdlg (translate_text_item("Error"), "Error " + errorcode + " : " + response);
console.log("Error " + errorcode + " : " + response);
}
function SPIFFSdispatchfilestatus(jsonresponse){
var content ="";
content =translate_text_item("Total:")+" "+jsonresponse.total;
content +="&nbsp;&nbsp;|&nbsp;&nbsp;" + translate_text_item("Used:")+ " " +jsonresponse.used;
content +="&nbsp;";
content +="<meter min='0' max='100' high='90' value='"+jsonresponse.occupation +"'></meter>&nbsp;"+jsonresponse.occupation +"%";
if (jsonresponse.status != "Ok")content +="<br>" + translate_text_item( jsonresponse.status);
document.getElementById('SPIFFS_status').innerHTML=content;
content ="";
if (SPIFFS_currentpath != "/"){
var pos = SPIFFS_currentpath.lastIndexOf("/",SPIFFS_currentpath.length-2)
var previouspath = SPIFFS_currentpath.slice(0,pos+1);
content +="<tr style='cursor:pointer;' onclick=\"SPIFFS_currentpath='"+previouspath+"'; SPIFFSSendCommand('list','all');\"><td >" + get_icon_svg("level-up")+ "</td><td colspan='4'> Up..</td></tr>";
}
jsonresponse.files.sort(function(a, b) {
return compareStrings(a.name, b.name);
});
for (var i=0;i <jsonresponse.files.length;i++){
//first display files
if (String(jsonresponse.files[i].size) != "-1")
{
content +="<tr>";
content +="<td style='vertical-align:middle; color:#5BC0DE'>" + get_icon_svg("file") + "</td>";
content +="<td width='100%' style='vertical-align:middle'><a href=\""+jsonresponse.path+jsonresponse.files[i].name+"\" target=_blank><button class=\"btn btn-link\">";
content +=jsonresponse.files[i].name;
content +="</button></a></td><td nowrap style='vertical-align:middle'>";
content +=jsonresponse.files[i].size;
content +="</td><td width='0%' style='vertical-align:middle'><button class=\"btn btn-danger btn-xs\" style='padding: 5px 5px 0px 5px;' onclick=\"SPIFFSDelete('"+jsonresponse.files[i].name+"')\">";
content +=get_icon_svg("trash");
content +="</button></td></tr>";
}
}
//then display directories
for (var i=0;i <jsonresponse.files.length;i++){
if (String(jsonresponse.files[i].size) == "-1")
{
content +="<tr>";
content+="<td style='vertical-align:middle ; color:#5BC0DE'>" + get_icon_svg("folder-close") + "</td>";
content +="<td width='100%' style='vertical-align:middle'><button class=\"btn btn-link\" onclick=\"SPIFFSselect_dir('" + jsonresponse.files[i].name+"');\">";
content +=jsonresponse.files[i].name;
content +="</button></td><td>";
content +="</td><td width='0%' style='vertical-align:middle'><button class=\"btn btn-danger btn-xs\" style='padding: 5px 4px 0px 4px;' onclick=\"SPIFFSDeletedir('"+jsonresponse.files[i].name+"')\">";
content +=get_icon_svg("trash");
content +="</button></td></tr>";
}
}
document.getElementById('SPIFFS_file_list').innerHTML=content;
document.getElementById('SPIFFS_path').innerHTML=SPIFFSnavbar();
}
function refreshSPIFFS() {
document.getElementById('refreshSPIFFSbtn').style.display='none';
//removeIf(production)
var response = "{\"files\":[{\"name\":\"config.html.gz\",\"size\":\"4.76 KB\"},{\"name\":\"index.html.gz\",\"size\":\"21.44 KB\"},{\"name\":\"favicon.ico\",\"size\":\"1.12 KB\"},{\"name\":\"config.htm\",\"size\":\"19.65 KB\"},{\"name\":\"config2.htm\",\"size\":\"19.98 KB\"},{\"name\":\"Testname\",\"size\":\"-1\"},{\"name\":\"index2.html.gz\",\"size\":\"28.89 KB\"}],\"path\":\"/\",\"status\":\"Ok\",\"total\":\"2.81 MB\",\"used\":\"118.88 KB\",\"occupation\":\"4\"}";
SPIFFSsuccess(response);
return;
//endRemoveIf(production)
SPIFFSSendCommand('list','all');
}
function checkSPIFFSfiles(){
var files = document.getElementById('SPIFFS-select').files;
document.getElementById('uploadSPIFFSmsg').style.display='none';
if (files.length==0)document.getElementById('SPIFFS_uploadbtn').style.display = 'none';
else document.getElementById('SPIFFS_uploadbtn').style.display = 'block';
}
function SPIFFSUploadProgressDisplay(oEvent){
if (oEvent.lengthComputable) {
var percentComplete = (oEvent.loaded / oEvent.total)*100;
document.getElementById('SPIFFS_prg').value=percentComplete;
document.getElementById('uploadSPIFFSmsg').innerHTML = translate_text_item("Uploading ") + SPIFFS_currentfile + " " + percentComplete.toFixed(0)+"%" ;
} else {
// Impossible because size is unknown
}
}
function SPIFFS_UploadFile( ) {
if (http_communication_locked) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Communications are currently locked, please wait and retry."));
return;
}
var files = document.getElementById('SPIFFS-select').files
var formData = new FormData();
var url = "/files";
formData.append('path', SPIFFS_currentpath);
for (var i = 0; i < files.length; i++) {
var file = files[i];
formData.append('myfile[]', file, SPIFFS_currentpath + file.name);
}
document.getElementById('SPIFFS-select').style.display = 'none';
document.getElementById('SPIFFS_uploadbtn').style.display = 'none';
SPIFFS_upload_ongoing=true;
document.getElementById('uploadSPIFFSmsg').style.display='block';
document.getElementById('SPIFFS_prg').style.display = 'block';
if (files.length == 1)SPIFFS_currentfile = files[0].name;
else SPIFFS_currentfile = "";
document.getElementById('uploadSPIFFSmsg').innerHTML = translate_text_item("Uploading ") + SPIFFS_currentfile;
SendFileHttp(url, formData, SPIFFSUploadProgressDisplay, SPIFFSUploadsuccess, SPIFFSUploadfailed)
}
function SPIFFSUploadsuccess(response){
document.getElementById('SPIFFS-select').value="";
document.getElementById('SPIFFS-select').style.display = 'block';
document.getElementById('SPIFFS_prg').style.display = 'none';
document.getElementById('SPIFFS_uploadbtn').style.display = 'none';
document.getElementById('uploadSPIFFSmsg').innerHTML ="";
document.getElementById('refreshSPIFFSbtn').style.display='block';
SPIFFS_upload_ongoing=false;
response = response.replace("\"status\":\"Ok\"", "\"status\":\"Upload done\"");
var jsonresponse = JSON.parse(response);
SPIFFSdispatchfilestatus(jsonresponse);
}
function SPIFFSUploadfailed(errorcode, response){
document.getElementById('SPIFFS-select').style.display = 'block';
document.getElementById('SPIFFS_prg').style.display = 'none';
document.getElementById('SPIFFS_uploadbtn').style.display = 'block';
document.getElementById('uploadSPIFFSmsg').innerHTML = translate_text_item("Upload failed : ") + errorcode + " :" + response;
document.getElementById('refreshSPIFFSbtn').style.display='block';
console.log("Error " + errorcode + " : " + response);
SPIFFS_upload_ongoing=false;
}

10
www/js/alertdlg.js Normal file
View File

@@ -0,0 +1,10 @@
//alert dialog
function alertdlg (titledlg, textdlg, closefunc) {
var modal = setactiveModal('alertdlg.html',closefunc);
if ( modal == null) return;
var title = modal.element.getElementsByClassName("modal-title")[0];
var body = modal.element.getElementsByClassName("modal-text")[0];
title.innerHTML=titledlg;
body.innerHTML=textdlg;
showModal() ;
}

66
www/js/app.js Normal file
View File

@@ -0,0 +1,66 @@
window.onload = function() {
//to check if javascript is disabled like in anroid preview
document.getElementById('warningmsg').style.display = 'none';
connectdlg();
};
window.addEventListener("resize", OnresizeWindow);
function OnresizeWindow(){
}
function initUI() {
//initial check
if ((typeof target_firmware == "undefined") || (typeof web_ui_version == "undefined") || (typeof direct_sd == "undefined") ) alert('Missing init data!');
//check FW
var fwName;
if (target_firmware == "repetier" ) {
fwName = "Repetier";
document.getElementById('configtablink').style.display = 'block';
}
else if (target_firmware == "repetier4davinci" ) {
fwName = "Repetier for Davinci";
document.getElementById('configtablink').style.display = 'block';
}
else if (target_firmware == "smoothieware" ) {
fwName = "Smoothieware";
document.getElementById('configtablink').style.display = 'block';
}
else if (target_firmware == "marlin" ) fwName = "Marlin";
else if (target_firmware == "marlinkimbra" ) fwName = "Marlin Kimbra";
else fwName = "Unknown";
if (typeof document.getElementById('fwName') != "undefined")document.getElementById('fwName').innerHTML=fwName;
//update UI version
if (typeof document.getElementById('UI_VERSION') != "undefined")document.getElementById('UI_VERSION').innerHTML=web_ui_version;
//update FW version
if (typeof document.getElementById('FW_VERSION') != "undefined")document.getElementById('FW_VERSION').innerHTML=fw_version;
//SD image or not
if (direct_sd && typeof document.getElementById('showSDused')!= "undefined")document.getElementById('showSDused').innerHTML="<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'><g transform='translate(50,1200) scale(1, -1)'><path fill='#777777' d='M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z' /></g></svg>";
// Get the element with id="defaultOpen" and click on it
document.getElementById("maintablink").click();
//var value = get_localdata('language');
//translate_text(value);
//removeIf(production)
console.log(JSON.stringify(translated_list));
//endRemoveIf(production)
//get all settings from ESP3D
refreshSettings();
//init panels
init_temperature_panel();
init_extruder_panel();
init_command_panel();
init_controls_panel();
init_files_panel();
}
function compareStrings(a, b) {
// case-insensitive comparison
a = a.toLowerCase();
b = b.toLowerCase();
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
function compareInts(a, b) {
return (a < b) ? -1 : (a > b) ? 1 : 0;
}

96
www/js/camera.js Normal file
View File

@@ -0,0 +1,96 @@
var cam_is_checked=false;
function OnCheckCam() {
if (typeof document.getElementById('camcheck') != "undefined") {
cam_is_checked = !cam_is_checked;
document.getElementById("camcheck").checked = cam_is_checked;
if (typeof document.getElementById('camtab') != "undefined") {
if (cam_is_checked){
document.getElementById('camtablink').style.display = "block";
document.getElementById("camtablink").click();
var saddress = document.getElementById('camera_webaddress').value
if (saddress.length == 0)camera_GetAddress();
}
else {
document.getElementById("maintablink").click();
document.getElementById('camtablink').style.display = "none";
}
}
}
}
function cameraformataddress() {
var saddress = document.getElementById('camera_webaddress').value;
var saddressl =saddress.trim().toLowerCase();
saddress =saddress.trim();
if (saddress.length > 0) {
if ( !(saddressl.indexOf("https://") != -1 || saddressl.indexOf("http://") != -1 || saddressl.indexOf("rtp://") != -1 || saddressl.indexOf("rtps://") != -1 || saddressl.indexOf("rtp://") != -1 )) {
saddress = "http://" + saddress;
}
}
document.getElementById('camera_webaddress').value = saddress;
}
function camera_loadframe(){
var saddress = document.getElementById('camera_webaddress').value;
saddress =saddress.trim();
if(saddress.length == 0) {
document.getElementById('camera_frame').src = "";
document.getElementById('camera_frame_display').style.display = "none";
}
else{
cameraformataddress();
document.getElementById('camera_frame').src = document.getElementById('camera_webaddress').value;
document.getElementById('camera_frame_display').style.display = "block";
}
}
function camera_OnKeyUp(event){
if (event.keyCode == 13) {
camera_loadframe();
}
return true;
}
function DisplayAddress(webaddress){
document.getElementById('camera_webaddress').value = webaddress;
cameraformataddress();
camera_loadframe();
}
function camera_GetAddress(){
var url = "/command?plain="+encodeURIComponent("[ESP301]");
SendGetHttp(url, camera_GetAddressSuccess, camera_GetAddressFailed);
}
function camera_saveaddress(){
var saddress = "";
var url = "";
cameraformataddress();
saddress = document.getElementById('camera_webaddress').value;
url = "/command?plain="+encodeURIComponent("[ESP300]" + saddress);
SendGetHttp(url, camera_saveaddressSuccess, camera_saveaddressFailed);
}
function camera_detachcam(){
var webaddress = document.getElementById('camera_frame').src;
document.getElementById('camera_frame').src = "";
document.getElementById('camera_frame_display').style.display = "none";
window.open(webaddress);
}
function camera_GetAddressSuccess(response){
//console.log(response);
DisplayAddress(response);
}
function camera_GetAddressFailed(error_code,response){
console.log("Error " + error_code + " :" + response);
}
function camera_saveaddressSuccess(response){
//console.log(response);
}
function camera_saveaddressFailed(error_code,response){
console.log("Error " + error_code + " :" + response);
}

112
www/js/commands.js Normal file
View File

@@ -0,0 +1,112 @@
var CustomCommand_history = [];
var CustomCommand_history_index = -1;
var Monitor_output = [];
function init_command_panel(){
var value = get_localdata('monitor_autoscroll');
if (value == 'true'){
document.getElementById('monitor_enable_autoscroll').checked =true;
Monitor_check_autoscroll();
}
value = get_localdata('monitor_filter_temperatures');
if (value == 'true'){
document.getElementById('monitor_enable_filter_temperatures').checked =true;
Monitor_check_filter_temperatures();
}
}
function Monitor_output_autoscrollcmd(){
document.getElementById('cmd_content').scrollTop = document.getElementById('cmd_content').scrollHeight;
}
function Monitor_check_autoscroll(){
if (document.getElementById('monitor_enable_autoscroll').checked == true) Monitor_output_autoscrollcmd();
store_localdata('monitor_autoscroll', document.getElementById('monitor_enable_autoscroll').checked);
}
function Monitor_check_filter_temperatures(){
Monitor_output_Update();
store_localdata('monitor_filter_temperatures', document.getElementById('monitor_enable_filter_temperatures').checked);
}
function Monitor_output_Clear(){
Monitor_output = [];
Monitor_output_Update();
}
function Monitor_output_Update(message){
if (message) {
if (typeof message === 'string' || message instanceof String) {
Monitor_output = Monitor_output.concat(message);
}
else
{
try {
var msg = JSON.stringify(message, null, " ");
Monitor_output= Monitor_output.concat(msg + "\n");
}
catch(err) {
Monitor_output = Monitor_output.concat(message.toString() + "\n");
}
}
Monitor_output = Monitor_output.slice(-300);
}
var regex = /ok T:/g;
if (target_firmware == "repetier" || target_firmware == "repetier4davinci"){
regex = /T:/g;
}
var output = "";
var Monitor_outputLength = Monitor_output.length;
var istempfilter = document.getElementById("monitor_enable_filter_temperatures").checked;
for (var i = 0; i < Monitor_outputLength; i++) {
if (istempfilter && Monitor_output[i].match(regex)) continue;
if ((Monitor_output[i].trim()==="\n") || (Monitor_output[i].trim()==="\r") || (Monitor_output[i].trim()==="\r\n") || (Monitor_output[i].trim()==="") )continue;
else output += Monitor_output[i];
}
document.getElementById("cmd_content").innerHTML = output;
Monitor_check_autoscroll();
}
function SendCustomCommand(){
var cmd = document.getElementById("custom_cmd_txt").value ;
var url = "/command?commandText=";
cmd = cmd.trim();
if (cmd.trim().length == 0) return;
CustomCommand_history.push(cmd);
CustomCommand_history.slice(-40);
CustomCommand_history_index = CustomCommand_history.length;
document.getElementById("custom_cmd_txt").value = "";
Monitor_output_Update(cmd + "\n");
SendGetHttp(url + encodeURI(cmd), SendCustomCommandSuccess, SendCustomCommandFailed);
//console.log(cmd);
}
function CustomCommand_OnKeyUp(event){
if (event.keyCode == 13) {
SendCustomCommand();
}
if (event.keyCode == 38 || event.keyCode == 40) {
if (event.keyCode == 38 && CustomCommand_history.length > 0 && CustomCommand_history_index > 0) {
CustomCommand_history_index--;
} else if (event.keyCode == 40 &&CustomCommand_history_index < CustomCommand_history.length - 1) {
CustomCommand_history_index++;
}
if (CustomCommand_history_index >= 0 &&CustomCommand_history_index < CustomCommand_history.length) {
document.getElementById("custom_cmd_txt").value = CustomCommand_history[CustomCommand_history_index];
}
return false;
}
return true;
}
function SendCustomCommandSuccess(response){
if (response[response.length-1] != '\n')Monitor_output_Update(response + "\n");
else Monitor_output_Update(response);
}
function SendCustomCommandFailed(error_code,response){
Monitor_output_Update("Error " + error_code + " :" + response+ "\n");
console.log("Error " + error_code + " :" + response);
}

321
www/js/config.js Normal file
View File

@@ -0,0 +1,321 @@
var config_configList = [];
var config_error_msg="";
var config_lastindex = -1;
var commandtxt = "M205";
function refreshconfig() {
if (http_communication_locked) {
document.getElementById('config_status').innerHTML=translate_text_item("Communication locked by another process, retry later.");
return;
}
document.getElementById('config_loader').style.display="block";
document.getElementById('config_list_content').style.display="none";
document.getElementById('config_status').style.display="none";
document.getElementById('config_refresh_btn').style.display="none";
config_configList = [];
//removeIf(production)
var response_text = "";
if (target_firmware == "smoothieware")response_text = "# Robot module configurations : general handling of movement G-codes and slicing into moves\ndefault_feed_rate 4000 # Default rate ( mm/minute ) for G1/G2/G3 moves\ndefault_seek_rate 4000 # Default rate ( mm/minute ) for G0 moves\nmm_per_arc_segment 0.0 # Fixed length for line segments that divide arcs 0 to disable\nmm_max_arc_error 0.01 # The maximum error for line segments that divide arcs 0 to disable\n # note it is invalid for both the above be 0\n # if both are used, will use largest segment length based on radius\n#mm_per_line_segment 5 # Lines can be cut into segments ( not usefull with cartesian coordinates robots ).\n\n# Arm solution configuration : Cartesian robot. Translates mm positions into stepper positions\nalpha_steps_per_mm 80 # Steps per mm for alpha stepper\nbeta_steps_per_mm 80 # Steps per mm for beta stepper\ngamma_steps_per_mm 1637.7953 # Steps per mm for gamma stepper\n\n# Planner module configuration : Look-ahead and acceleration configuration\nplanner_queue_size 32 # DO NOT CHANGE THIS UNLESS YOU KNOW EXACTLY WHAT YOUR ARE DOING\nacceleration 3000 # Acceleration in mm/second/second.\n#z_acceleration 500 # Acceleration for Z only moves in mm/s^2, 0 disables it, disabled by default. DO NOT SET ON A DELTA\njunction_deviation 0.05 # Similar to the old max_jerk, in millimeters, see : https://github.com/grbl/grbl/blob/master/planner.c#L409\n # and https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8 . Lower values mean being more careful, higher values means being faster and have more jerk\n\n# Stepper module configuration\nmicroseconds_per_step_pulse 1 # Duration of step pulses to stepper drivers, in microseconds\nbase_stepping_frequency 100000 # Base frequency for stepping\n\n# Stepper module pins ( ports, and pin numbers, appending ! to the number will invert a pin )\nalpha_step_pin 2.1 # Pin for alpha stepper step signal\nalpha_dir_pin 0.11 # Pin for alpha stepper direction\nalpha_en_pin 0.10! # Pin for alpha enable pin\nalpha_current 1.0 # X stepper motor current\nx_axis_max_speed 30000 # mm/min\nalpha_max_rate 30000.0 # mm/min actuator max speed;";
else response_text = "EPR:0 1028 7 Language\nEPR:2 75 230400 Baudrate\nEPR:0 1125 1 Display Mode:\nEPR:0 1119 1 Light On:\nEPR:0 1127 1 Keep Light On:\nEPR:0 1126 0 Filament Sensor On:\nEPR:0 1176 0 Top Sensor On:\nEPR:0 1120 1 Sound On:\nEPR:0 1177 1 Wifi On:\nEPR:3 129 0.000 Filament printed [m]\nEPR:2 125 0 Printer active [s]\nEPR:2 79 0 Max. inactive time [ms,0=off]\nEPR:2 83 360000 Stop stepper after inactivity [ms,0=off]\nEPR:2 1121 0 Powersave after [ms,0=off]:\nEPR:3 1160 180.000 Temp Ext PLA:\nEPR:3 1164 230.000 Temp Ext ABS:\nEPR:3 1168 60.000 Temp Bed PLA:\nEPR:3 1172 90.000 Temp Bed ABS:\nEPR:3 1179 2.000 Load Feed Rate:\nEPR:3 1183 4.000 Unload Feed Rate:\nEPR:3 1187 60.000 Unload/Load Distance:\nEPR:3 3 80.0000 X-axis steps per mm\nEPR:3 7 80.0000 Y-axis steps per mm\nEPR:3 11 2560.0000 Z-axis steps per mm\nEPR:3 15 200.000 X-axis max. feedrate [mm/s]\nEPR:3 19 200.000 Y-axis max. feedrate [mm/s]\nEPR:3 23 5.000 Z-axis max. feedrate [mm/s]\nEPR:3 27 40.000 X-axis homing feedrate [mm/s]\nEPR:3 31 40.000 Y-axis homing feedrate [mm/s]\nEPR:3 35 4.000 Z-axis homing feedrate [mm/s]\nEPR:3 39 20.000 Max. jerk [mm/s]\nEPR:3 47 0.342 Max. Z-jerk [mm/s]\nEPR:3 133 0.000 X min pos [mm]\nEPR:3 137 0.000 Y min pos [mm]\nEPR:3 141 0.000 Z min pos [mm]\nEPR:3 145 199.000 X max length [mm]\nEPR:3 149 204.000 Y max length [mm]\nEPR:3 153 200.000 Z max length [mm]\nEPR:3 51 1000.000 X-axis acceleration [mm/s^2]\nEPR:3 55 1000.000 Y-axis acceleration [mm/s^2]\nEPR:3 59 100.000 Z-axis acceleration [mm/s^2]\nEPR:3 63 1000.000 X-axis travel acceleration [mm/s^2]\nEPR:3 67 1000.000 Y-axis travel acceleration [mm/s^2]\nEPR:3 71 150.000 Z-axis travel acceleration [mm/s^2]\nEPR:3 1024 0.000 Coating thickness [mm]\nEPR:3 1128 100.000 Manual-probe X1 [mm]\nEPR:3 1132 180.000 Manual-probe Y1 [mm]\nEPR:3 1136 100.000 Manual-probe X2 [mm]\nEPR:3 1140 10.000 Manual-probe Y2 [mm]\nEPR:3 1144 50.000 Manual-probe X3 [mm]\nEPR:3 1148 95.000 Manual-probe Y3 [mm]\nEPR:3 1152 150.000 Manual-probe X4 [mm]\nEPR:3 1156 95.000 Manual-probe Y4 [mm]\nEPR:3 808 0.280 Z-probe height [mm]\nEPR:3 929 5.000 Max. z-probe - bed dist. [mm]\nEPR:3 812 1.000 Z-probe speed [mm/s]\nEPR:3 840 30.000 Z-probe x-y-speed [mm/s]\nEPR:3 800 0.000 Z-probe offset x [mm]\nEPR:3 804 0.000 Z-probe offset y [mm]\nEPR:3 816 36.000 Z-probe X1 [mm]\nEPR:3 820 -7.000 Z-probe Y1 [mm]\nEPR:3 824 36.000 Z-probe X2 [mm]\nEPR:3 828 203.000 Z-probe Y2 [mm]\nEPR:3 832 171.000 Z-probe X3 [mm]\nEPR:3 836 203.000 Z-probe Y3 [mm]\nEPR:3 1036 0.000 Z-probe bending correction A [mm]\nEPR:3 1040 0.000 Z-probe bending correction B [mm]\nEPR:3 1044 0.000 Z-probe bending correction C [mm]\nEPR:0 880 0 Autolevel active (1/0)\nEPR:0 106 2 Bed Heat Manager [0-3]\nEPR:0 107 255 Bed PID drive max\nEPR:0 124 80 Bed PID drive min\nEPR:3 108 196.000 Bed PID P-gain\nEPR:3 112 33.000 Bed PID I-gain\nEPR:3 116 290.000 Bed PID D-gain\nEPR:0 120 255 Bed PID max value [0-255]\nEPR:0 1020 0 Enable retraction conversion [0/1]\nEPR:3 992 3.000 Retraction length [mm]\nEPR:3 996 13.000 Retraction length extruder switch [mm]\nEPR:3 1000 40.000 Retraction speed [mm/s]\nEPR:3 1004 0.000 Retraction z-lift [mm]\nEPR:3 1008 0.000 Extra extrusion on undo retract [mm]\nEPR:3 1012 0.000 Extra extrusion on undo switch retract [mm]\nEPR:3 1016 20.000 Retraction undo speed\nEPR:3 200 99.000 Extr.1 steps per mm\nEPR:3 204 50.000 Extr.1 max. feedrate [mm/s]\nEPR:3 208 20.000 Extr.1 start feedrate [mm/s]\nEPR:3 212 5000.000 Extr.1 acceleration [mm/s^2]\nEPR:0 216 3 Extr.1 heat manager [0-3]\nEPR:0 217 230 Extr.1 PID drive max\nEPR:0 245 40 Extr.1 PID drive min\nEPR:3 218 3.0000 Extr.1 PID P-gain/dead-time\nEPR:3 222 2.0000 Extr.1 PID I-gain\nEPR:3 226 40.0000 Extr.1 PID D-gain\nEPR:0 230 255 Extr.1 PID max value [0-255]\nEPR:2 231 0 Extr.1 X-offset [steps]\nEPR:2 235 0 Extr.1 Y-offset [steps]\nEPR:2 290 0 Extr.1 Z-offset [steps]\nEPR:1 239 1 Extr.1 temp. stabilize time [s]\nEPR:1 250 150 Extr.1 temp. for retraction when heating [C]\nEPR:1 252 0 Extr.1 distance to retract when heating [mm]\nEPR:0 254 255 Extr.1 extruder cooler speed [0-255]\nEPR:3 246 0.000 Extr.1 advance L [0=off]\nEPR:3 300 99.000 Extr.2 steps per mm\nEPR:3 304 50.000 Extr.2 max. feedrate [mm/s]\nEPR:3 308 20.000 Extr.2 start feedrate [mm/s]\nEPR:3 312 5000.000 Extr.2 acceleration [mm/s^2]\nEPR:0 316 3 Extr.2 heat manager [0-3]\nEPR:0 317 230 Extr.2 PID drive max\nEPR:0 345 40 Extr.2 PID drive min\nEPR:3 318 3.0000 Extr.2 PID P-gain/dead-time\nEPR:3 322 2.0000 Extr.2 PID I-gain\nEPR:3 326 40.0000 Extr.2 PID D-gain\nEPR:0 330 255 Extr.2 PID max value [0-255]\nEPR:2 331 -2852 Extr.2 X-offset [steps]\nEPR:2 335 12 Extr.2 Y-offset [steps]\nEPR:2 390 0 Extr.2 Z-offset [steps]\nEPR:1 339 1 Extr.2 temp. stabilize time [s]\nEPR:1 350 150 Extr.2 temp. for retraction when heating [C]\nEPR:1 352 0 Extr.2 distance to retract when heating [mm]\nEPR:0 354 255 Extr.2 extruder cooler speed [0-255]\nEPR:3 346 0.000 Extr.2 advance L [0=off]\n";
getESPconfigSuccess(response_text);
return;
//endRemoveIf(production)
if (target_firmware == "smoothieware" ) commandtxt = "cat /sd/config";
getprinterconfig();
}
function getprinterconfig() {
var url = "/command?plain="+encodeURIComponent(commandtxt);
SendGetHttp(url, getESPconfigSuccess, getESPconfigfailed)
}
function build_HTML_config_list(){
var content="";
for (var i = 0; i < config_configList.length ; i++){
content+="<tr>";
if (config_configList[i].showcomment){
content+="<td colspan='3' class='info'>";
content+=config_configList[i].comment;
}
else {
content+="<td style='vertical-align:middle'>";
content+=config_configList[i].label;
content+="</td>";
content+="<td style='vertical-align:middle'>";
content+="<div class='input-group'>";
content+="<span class='input-group-btn'>";
content+="<button class='btn btn-default' onclick='config_revert_to_default("+i+")' >";
content+=get_icon_svg("repeat");
content+="</button>";
content+="</span>";
content+="<div id='status_config_"+ i + "' class='form-group has-feedback' >";
content+="<input id='config_" + i + "' type='text' class='form-control' style='width:auto' value='" + config_configList[i].defaultvalue + "' onkeyup='config_checkchange(" + i +")' >";
content+="<span id='icon_config_"+ i + "'class='form-control-feedback' ></span>";
content+="</div>";
content+="<span class='input-group-btn'>";
content+="<button id='btn_config_"+ i + "' class='btn btn-default' onclick='configetvalue("+ i +")' translate english_content='Set' >" + translate_text_item("Set") + "</button>&nbsp;";
content+="</span>";
content+="</div>";
content+="</td>";
content+="<td style='vertical-align:middle'>";
content+=config_configList[i].help;
}
content+="</td>";
content+="</tr>\n";
}
if (content.length > 0) document.getElementById('config_list_data').innerHTML = content;
}
function config_check_value(value, index){
var isvalid = true;
if (target_firmware == "smoothieware"){
if ((value.trim()[0] == '-') || ( value.length === 0) || (value.toLowerCase().indexOf("#")!=-1)){
isvalid = false;
config_error_msg = translate_text_item( "cannot have '-', '#' char or be empty");
}
}
else {
if ((value.trim()[0] == '-') || ( value.length === 0) || (value.toLowerCase().indexOf("e")!=-1)){
isvalid = false;
config_error_msg = translate_text_item( "cannot have '-', 'e' char or be empty");
}
}
return isvalid ;
}
function process_config_answer(response_text) {
var result= true;
config_configList = [];
var tlines = response_text.split("\n");
if (tlines.length <= 2){
if ((target_firmware == "smoothieware") && (commandtxt != "cat /sd/config.txt")){
commandtxt = "cat /sd/config.txt";
getprinterconfig();
}
else {
//console.log("No config file" );
if ((target_firmware == "smoothieware")) document.getElementById('config_status').innerHTML=translate_text_item( "File config / config.txt not found!");
else document.getElementById('config_status').innerHTML=translate_text_item("Cannot get EEPROM content!");
result = false;
}
}
else {
//console.log("Config has " + tlines.length + " entries");
var vindex = 0;
for (var i = 0; i <tlines.length ; i++) {
vindex = create_config_entry(tlines[i], vindex);
}
if (vindex > 0 ) build_HTML_config_list();
else result = false;
}
return result;
}
function create_config_entry(sentry, vindex){
var iscomment ;
var ssentry = sentry;
if (!is_config_entry(ssentry))return vindex;
//console.log(ssentry);
while( ssentry.indexOf(" ") > -1){
ssentry = ssentry.replace(" "," ");
}
while( ssentry.indexOf("##") > -1){
ssentry = ssentry.replace("##","#");
}
iscomment= is_config_commented(ssentry);
if (iscomment){
var config_entry = {comment: ssentry, showcomment: true, index: vindex, label: "",help: "", defaultvalue: "", cmd: ""};
config_configList.push(config_entry);
}
else {
var slabel = get_config_label(ssentry);
var svalue = get_config_value(ssentry);
var shelp = get_config_help(ssentry);
var scmd = get_config_command(ssentry)
var config_entry = {comment: ssentry, showcomment: false, index: vindex, label: slabel,help: shelp, defaultvalue: svalue, cmd: scmd};
config_configList.push(config_entry);
}
vindex++;
return vindex;
}
//check it is valid entry
function is_config_entry(sline){
var line = sline.trim();
if (line.length == 0) return false;
if (target_firmware == "smoothieware"){
return true;
} else {
if (line.indexOf("EPR:") ==0) return true;
else return false
}
}
function get_config_label(sline){
var tline = sline.trim().split(" ");
var tsize = tline.length;
if (target_firmware== "smoothieware"){
return tline[0];
} else {
if (tsize >3){
var result = "";
var i = 0;
for (i = 3; i < tsize ; i++){
if (tline[i][0] == '[') break;
result += tline[i]+" ";
}
return result;
}
else return "???";
}
}
function get_config_value(sline){
var tline = sline.split(" ");
if ( target_firmware == "smoothieware"){
if ((tline.length >1) && tline[0][0]!='#') return tline[1];
else return "???";
} else {
if ( tline.length >3){
return tline[2];
} else return "???";
}
}
function get_config_help(sline){
if (target_firmware== "smoothieware"){
var pos = sline.indexOf("#");
if (pos > -1) return sline.slice(pos+1,sline.length);
else return "";
} else {
var tline = sline.split("[");
if (tline.length > 1){
var tline2 = tline[1].split("]");
return tline2[0];
} else return "";
}
}
function get_config_command(sline){
var command;
if (target_firmware == "smoothieware"){
command = "config-set sd " + get_config_label(sline) + " ";
return command;
} else {
var tline = sline.split(" ");
if ( tline.length >3){
var stype = tline[0].split(":");
command = "M206 T" + stype[1];
command += " P" + tline[1];
if (stype[1] == "3") command += " X";
else command += " S";
return command;
} else return "; ";
}
}
function is_config_commented(sline){
var line = sline.trim();
if (line.length == 0) return false;
if (target_firmware == "smoothieware"){
if (line[0] == '#')return true;
return false;
} else {
return false;
}
}
function config_revert_to_default(index){
document.getElementById('config_'+index).value = config_configList[index].defaultvalue
document.getElementById('btn_config_'+index).className = "btn btn-default";
document.getElementById('status_config_'+index).className="form-group has-feedback";
document.getElementById('icon_config_'+index).innerHTML="";
}
function configetvalue(index) {
//remove possible spaces
value = document.getElementById('config_'+index).value.trim();
if (value == config_configList[index].defaultvalue) return;
//check validity of value
var isvalid = config_check_value(value, index);
//if not valid show error
if (!isvalid){
document.getElementById('btn_config_'+index).className = "btn btn-danger";
document.getElementById('icon_config_'+index).className="form-control-feedback has-error";
document.getElementById('icon_config_'+index).innerHTML=get_icon_svg("remove");
document.getElementById('status_config_'+index).className="form-group has-feedback has-error";
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be ") + config_error_msg + " !");
} else {
//value is ok save it
var cmd = config_configList[index].cmd + value;
config_lastindex = index;
config_configList[index].defaultvalue = value;
document.getElementById('btn_config_'+index).className = "btn btn-success";
document.getElementById('icon_config_'+index).className="form-control-feedback has-success";
document.getElementById('icon_config_'+index).innerHTML=get_icon_svg("ok");
document.getElementById('status_config_'+index).className="form-group has-feedback has-success";
var url = "/command?plain="+encodeURIComponent(cmd);
SendGetHttp(url, setESPconfigSuccess, setESPconfigfailed);
}
}
function config_checkchange(index) {
//console.log("check " + "config_"+index);
var val = document.getElementById('config_'+index).value.trim();
//console.log("value: " + val);
if (config_configList[index].defaultvalue == val){
document.getElementById('btn_config_'+index).className = "btn btn-default";
document.getElementById('icon_config_'+index).className="form-control-feedback";
document.getElementById('icon_config_'+index).innerHTML="";
document.getElementById('status_config_'+index).className="form-group has-feedback";
}
else if (config_check_value(val, index)){
document.getElementById('status_config_'+index).className="form-group has-feedback has-warning";
document.getElementById('btn_config_'+index).className = "btn btn-warning";
document.getElementById('icon_config_'+index).className="form-control-feedback has-warning";
document.getElementById('icon_config_'+index).innerHTML=get_icon_svg("warning-sign");
//console.log("change ok");
}
else {
//console.log("change bad");
document.getElementById('btn_config_'+index).className = "btn btn-danger";
document.getElementById('icon_config_'+index).className="form-control-feedback has-error";
document.getElementById('icon_config_'+index).innerHTML= get_icon_svg("remove");
document.getElementById('status_config_'+index).className="form-group has-feedback has-error";
}
}
function setESPconfigSuccess(response){
//console.log(response);
}
function setESPconfigfailed(error_code,response){
alertdlg (translate_text_item("Set failed"), "Error " + error_code + " :" + response);
console.log("Error " + error_code + " :" + response);
document.getElementById('btn_config_'+config_lastindex).className = "btn btn-danger";
document.getElementById('icon_config_'+config_lastindex).className="form-control-feedback has-error";
document.getElementById('icon_config_'+config_lastindex).innerHTML= get_icon_svg("remove");
document.getElementById('status_config_'+config_lastindex).className="form-group has-feedback has-error";
}
function getESPconfigSuccess(response){
//console.log(response);
if (!process_config_answer(response)){
getESPconfigfailed(406, translate_text_item("Wrong data"));
return;
}
document.getElementById('config_loader').style.display="none";
document.getElementById('config_list_content').style.display="block";
document.getElementById('config_status').style.display="none";
document.getElementById('config_refresh_btn').style.display="block";
}
function getESPconfigfailed(error_code,response){
console.log("Error " + error_code + " :" + response);
document.getElementById('config_loader').style.display="none";
document.getElementById('config_status').style.display="block";
document.getElementById('config_status').innerHTML=translate_text_item( "Failed:") + error_code + " " + response;
document.getElementById('config_refresh_btn').style.display="block";
}

10
www/js/confirmdlg.js Normal file
View File

@@ -0,0 +1,10 @@
//confirm dialog
function confirmdlg(titledlg, textdlg, closefunc) {
var modal = setactiveModal('confirmdlg.html',closefunc);
if ( modal == null) return;
var title = modal.element.getElementsByClassName("modal-title")[0];
var body = modal.element.getElementsByClassName("modal-text")[0];
title.innerHTML=titledlg;
body.innerHTML=textdlg;
showModal() ;
}

83
www/js/connectdlg.js Normal file
View File

@@ -0,0 +1,83 @@
//Connect dialog
function connectdlg () {
var value = get_localdata('language');
translate_text(value);
var modal = setactiveModal('connectdlg.html');
if ( modal == null) return;
showModal() ;
//removeIf(production)
connectsuccess("FW version:0.9.9X # FW target:Smoothieware # FW HW:Direct SD # primary : /sd/ # secondary : /ext/");
return;
//endRemoveIf(production)
retryconnect ();
}
function getFWdata(response){
var tlist = response.split("#");
//FW version:0.9.200 # FW target:smoothieware # FW HW:Direct SD # primary sd:/ext/ # secondary sd:/sd/
if (tlist.length < 3) {
return false;
}
//FW version
var sublist = tlist[0].split(":");
if (sublist.length != 2) {
return false;
}
fw_version = sublist[1].toLowerCase().trim();
//FW target
sublist = tlist[1].split(":");
if (sublist.length != 2) {
return false;
}
target_firmware = sublist[1].toLowerCase().trim();
//FW HW
sublist = tlist[2].split(":");
if (sublist.length != 2) {
return false;
}
var sddirect = sublist[1].toLowerCase().trim();
if (sddirect == "direct sd") direct_sd=true;
else direct_sd = false;
//primary sd
sublist = tlist[3].split(":");
if (sublist.length != 2) {
return false;
}
primary_sd = sublist[1].toLowerCase().trim();
//secondary sd
sublist = tlist[4].split(":");
if (sublist.length != 2) {
return false;
}
secondary_sd = sublist[1].toLowerCase().trim();
return true;
}
function connectsuccess(response){
if (getFWdata( response))
{
document.getElementById('main_ui').style.display='block';
closeModal("Connection successful");
initUI();
}
else {
console.log(response);
connectfailed(406, "Wrong data");
}
}
function connectfailed(errorcode, response){
document.getElementById('connectbtn').style.display='block';
document.getElementById('failed_connect_msg').style.display='block';
document.getElementById('connecting_msg').style.display='none';
console.log("Error " + errorcode + " : " + response);
}
function retryconnect () {
document.getElementById('connectbtn').style.display='none';
document.getElementById('failed_connect_msg').style.display='none';
document.getElementById('connecting_msg').style.display='block';
var url = "/command?plain="+encodeURIComponent("[ESP800]");;
SendGetHttp(url, connectsuccess, connectfailed)
}

220
www/js/controls.js vendored Normal file
View File

@@ -0,0 +1,220 @@
var interval_position=-1;
var control_macrolist = [];
function init_controls_panel(){
var value = get_localdata('autocheck_position');
if (value == 'true'){
document.getElementById('autocheck_position').checked =true;
on_autocheck_position();
}
loadmacrolist();
}
function loadmacrolist() {
control_macrolist = [];
var url = "/macrocfg.json";
//removeIf(production)
var response= "[{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":0},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":1},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":2},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":3},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":4},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":5},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":6},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":7},{\"name\":\"\",\"glyph\":\"\",\"filename\":\"\",\"target\":\"\",\"class\":\"\",\"index\":8}]";
processMacroGetSuccess(response);
return;
//endRemoveIf(production)
SendGetHttp(url, processMacroGetSuccess, processMacroGetFailed);
}
function Macro_build_list(response_text){
var response = [];
try {
var response = JSON.parse(response_text);
}
catch (e) {
console.error("Parsing error:", e);
}
for (var i = 0; i < 9 ; i++) {
var entry;
if ((response.length != 0) && (typeof(response[i].name ) !== 'undefined' && typeof(response[i].glyph ) !== 'undefined' && typeof(response[i].filename ) !== 'undefined' && typeof(response[i].target ) !== 'undefined' && typeof(response[i].class ) !== 'undefined' && typeof(response[i].index ) !== 'undefined' )) {
entry = {name : response[i].name, glyph: response[i].glyph, filename : response[i].filename, target : response[i].target, class : response[i].class, index: response[i].index};
}
else {
entry = {name :'', glyph: '', filename : '', target : '', class : '', index: i};
}
control_macrolist.push(entry);
}
control_build_macro_ui();
}
function processMacroGetSuccess(response){
Macro_build_list(response);
}
function processMacroGetFailed(errorcode, response){
console.log("Error " + errorcode + " : " + response);
Macro_build_list(response);
}
function on_autocheck_position(){
if (document.getElementById('autocheck_position').checked) {
store_localdata('autocheck_position', true);
var interval = parseInt(document.getElementById('posInterval_check').value);
if (!isNaN(interval) && interval > 0 && interval < 100) {
interval_position = setInterval(function(){ get_Position() }, interval * 1000);
}
else {
document.getElementById('autocheck_position').checked = false;
store_localdata('autocheck_position', false);
document.getElementById('posInterval_check').value = 0;
if (interval_position != -1 )clearInterval(interval_position);
interval_position = -1;
}
}
else {
store_localdata('autocheck_position', false);
if (interval_position != -1 )clearInterval(interval_position);
interval_position = -1;
}
}
function onPosIntervalChange(){
var interval = parseInt(document.getElementById('posInterval_check').value);
if (!isNaN(interval) && interval > 0 && interval < 100 ) {
if (interval_position != -1 )clearInterval(interval_position);
interval_position = setInterval(function(){ get_Position() }, interval * 1000);
}
else {
document.getElementById('autocheck_position').checked = false;
document.getElementById('posInterval_check').value = 0;
if (interval != 0)alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of auto-check must be between 0s and 99s !!"));
on_autocheck_position();
}
}
function get_Position(){
var command = "M114";
//removeIf(production)
var response = "ok C: X:0.0000 Y:0.0000 Z:0.0000 E:0.0000 ";
process_Position(response);
return;
//endRemoveIf(production)
SendPrinterCommand(command, false, process_Position);
}
function Control_get_position_value(label, result_data) {
var result = "";
var pos1 = result_data.indexOf(label, 0);
if (pos1 > -1){
pos1 += label.length;
var pos2 = result_data.indexOf(" ", pos1);
if (pos2 > -1){
result = result_data.substring(pos1,pos2);
}
}
return result.trim();
}
function process_Position(response){
document.getElementById('control_x_position').innerHTML = Control_get_position_value("X:", response);
document.getElementById('control_y_position').innerHTML = Control_get_position_value("Y:", response);
document.getElementById('control_z_position').innerHTML = Control_get_position_value("Z:", response);
}
function control_motorsOff(){
var command = "M84";
SendPrinterCommand(command, true);
}
function SendHomecommand (cmd){
SendPrinterCommand(cmd, true, get_Position);
}
function SendJogcommand(cmd, feedrate){
var feedratevalue = "";
var command ="";
if (feedrate == "XYfeedrate") {
feedratevalue = parseInt(document.getElementById('control_xy_velocity').value);
if (feedratevalue < 1 || feedratevalue > 9999 || isNaN(feedratevalue) || (feedratevalue === null)) {
alertdlg (translate_text_item("Out of range"), translate_text_item( "XY feedrate value must be between 1 mm/min and 9999 mm/min !"));
document.getElementById('control_xy_velocity').value = get_localdata('xy_velocity');
return;
}
} else {
feedratevalue = parseInt(document.getElementById('control_z_velocity').value);
if (feedratevalue < 1 || feedratevalue > 999 || isNaN(feedratevalue) || (feedratevalue === null)) {
alertdlg (translate_text_item("Out of range"), translate_text_item( "Z feedrate value must be between 1 mm/min and 999 mm/min !"));
document.getElementById('control_z_velocity').value = get_localdata('z_velocity');
return;
}
}
command = "G91\nG1 " + cmd + " F" + feedratevalue + "\nG90";
SendPrinterCommand(command, true, get_Position);
}
function onXYvelocityChange () {
var feedratevalue = parseInt(document.getElementById('control_xy_velocity').value);
if (feedratevalue < 1 || feedratevalue > 9999 || isNaN(feedratevalue) || (feedratevalue === null)) {
}
else store_localdata('xy_velocity', feedratevalue);
}
function onZvelocityChange () {
var feedratevalue = parseInt(document.getElementById('control_z_velocity').value);
if (feedratevalue < 1 || feedratevalue > 999 || isNaN(feedratevalue) || (feedratevalue === null)) {
}
else store_localdata('z_velocity', feedratevalue);
}
function processMacroSave(answer){
if (answer == "ok"){
//console.log("now rebuild list");
control_build_macro_ui();
}
}
function control_build_macro_button(index){
var content = "";
var entry = control_macrolist[index];
content+="<button class='btn "+control_macrolist[index].class+"' type='text' ";
if (entry.glyph.length == 0){
content+="style='visibility:hidden'";
}
content+= "onclick='macro_command (\"" + entry.target + "\",\"" + entry.filename + "\")'";
content+="><span style='position:relative; top:3px;'>";
if (entry.glyph.length == 0){
content+=get_icon_svg("star");
} else content+=get_icon_svg(entry.glyph);
content+="</span>";
if (entry.name.length > 0){
content+="&nbsp;";
}
content+=entry.name;
content+="</button>";
return content;
}
function control_build_macro_ui(){
var content = "";
for (var i = 0; i < 4 ; i++) {
content+="<tr><td>" + control_build_macro_button(i) + "</td><tr>";
}
document.getElementById('Macro_col1').innerHTML=content;
content = "";
for (var i = 4; i <9 ; i++) {
content+="<tr><td>" + control_build_macro_button(i) + "</td><tr>";
}
document.getElementById('Macro_col2').innerHTML=content;
}
function macro_command (target, filename) {
var cmd = ""
if (target == "ESP") {
cmd = "[ESP700]"+filename;
} else if (target == "SD") {
cmd = "play " + filename;
if (target_firmware != "smoothieware"){
cmd = "M23 " + filename + "\nM24";
}
} else return;
//console.log(cmd);
SendPrinterCommand(cmd);
}

6
www/js/creditsdlg.js Normal file
View File

@@ -0,0 +1,6 @@
//Credits dialog
function creditsdlg () {
var modal = setactiveModal('creditsdlg.html');
if ( modal == null) return;
showModal() ;
}

35
www/js/dropmenu.js Normal file
View File

@@ -0,0 +1,35 @@
function clear_drop_menu(event){
var item = get_parent_by_class(event.target, "dropdownselect");
var ignore_id="-1";
if (item!==null && typeof item.id!=='undefined'){
ignore_id = item.id;
}
var list = document.getElementsByClassName("dropmenu-content");
for (var index = 0; index < list.length ; index++){
var item2 = get_parent_by_class(list[index], "dropdownselect");
if ( item2 !== null && typeof item2.id!=='undefined' && item2.id!=ignore_id && list[index].classList.contains('show')) {
list[index].classList.remove('show');
}
}
}
function get_parent_by_class(item, classname){
if (item === null || typeof item === 'undefined') return null;
if (item.classList.contains(classname)) {
return item;
}
return get_parent_by_class(item.parentElement, classname);
}
function hide_drop_menu(event){
var item = get_parent_by_class(event.target, "dropmenu-content");
if (typeof item !== 'undefined' && item.classList.contains('show')) {
item.classList.remove('show');
}
}
function showhide_drop_menu(event){
var item = get_parent_by_class(event.target, "dropdownselect");
if (item === null) return;
var menu = item.getElementsByClassName("dropmenu-content")[0];
if (typeof menu !== 'undefined')menu.classList.toggle("show");
}

119
www/js/extruders.js Normal file
View File

@@ -0,0 +1,119 @@
function init_extruder_panel(){
var value = parseInt(get_localdata('e_length'));
if (!(isNaN(value))) document.getElementById('filament_length').value = value;
value = get_localdata('enable_second_extruder');
if (value == 'true'){
document.getElementById('enable_second_extruder').checked =true;
update_second_extruder();
}
}
function update_second_extruder(){
temperature_second_extruder(document.getElementById('enable_second_extruder').checked);
if (document.getElementById('enable_second_extruder').checked) {
document.getElementById('second_extruder_UI').style.display='table-row';
document.getElementById('temperature_secondExtruder').style.display='table-row';
}
else {
document.getElementById('second_extruder_UI').style.display='none';
document.getElementById('temperature_secondExtruder').style.display='none';
}
store_localdata('enable_second_extruder', document.getElementById('enable_second_extruder').checked);
}
function on_extruder_length_Change(){
var value = parseInt(document.getElementById('filament_length').value);
if (value < 0.001 || value > 9999 || isNaN(value) || (value === null)) {
}
else {
store_localdata('e_length', value);
}
}
function on_extruder_velocity_Change(){
var value = parseInt(document.getElementById('extruder_velocity').value);
if (value < 0.001 || value > 9999 || isNaN(value) || (value === null)) {
}
else {
store_localdata('e_velocity', value);
}
}
function Extrude_cmd(extruder, direction){
var filament_length = parseInt(document.getElementById('filament_length').value);
var velocity = parseInt(document.getElementById('extruder_velocity').value);
if (velocity < 1 || velocity > 9999 || isNaN(velocity) || (velocity === null)) {
document.getElementById('extruder_velocity').value = parseInt(get_localdata('e_velocity'));
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of extruder velocity must be between1 mm/min and 9999 mm/min !"));
return;
}
if (filament_length < 0.001 || filament_length > 9999 || isNaN(filament_length) || (filament_length === null)) {
document.getElementById('filament_length').value = parseInt(get_localdata('e_length'));
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of filament length must be between 0.001 mm and 9999 mm !"));
return;
}
//Todo send command by command TBD
var command = extruder +"\n"+"G91\nG1 E" + (filament_length * direction) + " F" + velocity + "\nG90"
SendPrinterCommand(command, true);
}
function flowInit_cmd(){
document.getElementById('flowSelectedValue').value = 100;
flowSet_cmd();
}
function flowSet_cmd(){
var command = "M221 S";
var value = parseInt(document.getElementById('flowSelectedValue').value);
if (value < 50 || value > 300 || isNaN(value)) {
document.getElementById('flowSelectedValue').value = 100;
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 50% and 300% !"));
}
else {
SendPrinterCommand(command + value, true);
}
}
function feedInit_cmd(){
document.getElementById('feedSelectedValue').value = 100;
feedSet_cmd();
}
function feedSet_cmd(){
var command = "M220 S";
var value = parseInt(document.getElementById('feedSelectedValue').value);
if (value < 25 || value > 150 || isNaN(value)) {
document.getElementById('feedSelectedValue').value = 100;
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 25% and 150% !"));
}
else {
SendPrinterCommand(command + value, true);
}
}
function fanOff_cmd(){
document.getElementById('fanSelectedValue').value = 0;
fanSet_cmd();
}
function fanSet_cmd(){
var command = "M106 S";
var fvalue = parseInt(document.getElementById('fanSelectedValue').value);
var value = Math.round((fvalue* 255)/100);
if (fvalue< 0 || fvalue>100 || isNaN(fvalue) || fvalue === null) {
document.getElementById('fanSelectedValue').value = 0;
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0% and 100% !"));
}
else {
SendPrinterCommand(command + value, true);
}
}
function extruder_handleKeyUp(event, target){
if (event.keyCode == 13) {
if (target == 'Feed')feedSet_cmd();
else if (target == 'Flow')flowSet_cmd();
else if (target == 'Fan')fanSet_cmd();
}
return true;
}

632
www/js/files.js Normal file
View File

@@ -0,0 +1,632 @@
var files_currentPath = "/";
var files_filter_sd_list = false;
var files_file_list = [];
var files_file_list_cache = [];
var files_status_list = [];
var files_current_file_index = -1;
var files_error_status ="";
function init_files_panel(){
if ( target_firmware == "smoothieware"){
files_currentPath =primary_sd;
document.getElementById('files_refresh_primary_sd_btn').innerHTML = primary_sd.substring(0, primary_sd.length-1);
document.getElementById('files_refresh_secondary_sd_btn').innerHTML = secondary_sd.substring(0, secondary_sd.length-1);
if (primary_sd.toLowerCase() != "none" )document.getElementById('files_refresh_primary_sd_btn').style.display="inline";
if (secondary_sd.toLowerCase() != "none" )document.getElementById('files_refresh_secondary_sd_btn').style.display="inline";
} else {
document.getElementById('files_refresh_btn').style.display="inline";
}
if (target_firmware != "marlin")document.getElementById('files_createdir_btn').style.display="inline";
files_set_button_as_filter(files_filter_sd_list);
files_refreshFiles(files_currentPath);
}
function files_set_button_as_filter(isfilter){
if (!isfilter){
document.getElementById('files_filter_glyph').innerHTML=get_icon_svg("filter", "1em","1em");
} else {
document.getElementById('files_filter_glyph').innerHTML=get_icon_svg("list-alt","1em","1em");
}
}
function files_filter_button(item){
files_filter_sd_list = !files_filter_sd_list;
files_set_button_as_filter(files_filter_sd_list);
files_build_display_filelist();
}
function files_build_file_line(index){
var content = "";
var entry = files_file_list[index];
var is_clickable = files_is_clickable(index);
if ((files_filter_sd_list && entry.isprintable) || (!files_filter_sd_list)){
content +="<li class='list-group-item list-group-hover' >";
content +="<div class='row'>";
content +="<div class='col-md-1 col-sm-1' ";
if (is_clickable){
content +="style='cursor:pointer;' onclick='files_click_file(" + index + ")'";
}
content +="><span style='color:DeepSkyBlue;'>";
if (entry.isdir == true) content +=get_icon_svg("folder-open") ;
else content +=get_icon_svg("file");
content +="</span ></div>";
content +="<div class='col-md-4 col-sm-4' ";
if (is_clickable){
content +="style='cursor:pointer;' onclick='files_click_file(" + index + ")' ";
}
content +=">" + entry.name + "</div>";
content +="<div class='col-md-2 col-sm-2'";
if (is_clickable){
content +="style='cursor:pointer;' onclick='files_click_file(" + index + ")' ";
}
content +=">"+ entry.size+"</div>";
content +="<div class='col-md-3 col-sm-3'";
if (is_clickable){
content +="style='cursor:pointer;' onclick='files_click_file(" + index + ")' ";
}
content +=">"+ entry.datetime+"</div>";
content +="<div class='col-md-2 col-sm-2'>";
content +="<div class='pull-right'>";
if (entry.isprintable){
content +="<button class='btn btn-xs btn-default' onclick='files_print(" + index + ")' style='padding-top: 4px;'>" + get_icon_svg("print","1em","1em") + "</button>";
}
content +="&nbsp;";
if (files_showdeletebutton(index)){
content +="<button class='btn btn-xs btn-danger' onclick='files_delete(" + index + ")' style='padding-top: 4px;'>" + get_icon_svg("trash","1em","1em") + "</button>";
}
content +="</div>";
content +="</div>";
content +="</div>";
content +="</li>";
}
return content;
}
function files_print(index){
var cmd = "";
if (target_firmware == "smoothieware"){
cmd = "play " + files_currentPath + files_file_list[index].name;
SendPrinterSilentCommand(cmd);
} else{
cmd = "M23 " + files_currentPath + files_file_list[index].name + "\nM24";
SendPrinterSilentCommand(cmd);
}
}
function files_Createdir(){
inputdlg(translate_text_item("Please enter directory name"), translate_text_item("Name:"), process_files_Createdir);
}
function process_files_Createdir(answer){
if (answer.length > 0) files_create_dir(answer.trim());
}
function files_create_dir(name){
if (direct_sd && !((target_firmware == "smoothieware") && files_currentPath.startsWith(secondary_sd))){
var cmdpath = files_currentPath;
if (target_firmware == "smoothieware")cmdpath = files_currentPath.substring(primary_sd.length);
var url = "/upload?path="+encodeURIComponent(cmdpath)+"&action=createdir&filename=" + encodeURIComponent(name);
document.getElementById('files_nav_loader').style.display="block";
SendGetHttp(url, files_directSD_list_success, files_directSD_list_failed);
} else {
var command="";
if (target_firmware == "smoothieware") {
command = "mkdir " + files_currentPath + name;
} else {
command = "M32 " + files_currentPath + name;
}
SendPrinterCommand(command,true,files_proccess_and_update);
}
}
function files_delete(index){
files_current_file_index = index;
var msg = translate_text_item("Confirm deletion of directory: ");
if (!files_file_list[index].isdir)msg = translate_text_item("Confirm deletion of file: ");
confirmdlg(translate_text_item("Please Confirm"), msg + files_file_list[index].name, process_files_Delete);
}
function process_files_Delete(answer){
if (answer == "yes" && files_current_file_index != -1)files_delete_file(files_current_file_index);
files_current_file_index = -1;
}
function files_delete_file(index){
files_error_status = "Delete " + files_file_list[index].name;
if (direct_sd && !((target_firmware == "smoothieware") && files_currentPath.startsWith(secondary_sd))){
var cmdpath = files_currentPath;
if (target_firmware == "smoothieware")cmdpath = files_currentPath.substring(primary_sd.length);
var url = "/upload?path="+encodeURIComponent(cmdpath)+"&action=";
if (files_file_list[index].isdir){
url+="deletedir&filename=";
} else {
url+="delete&filename=";
}
url+=encodeURIComponent(files_file_list[index].sdname);
document.getElementById('files_nav_loader').style.display="block";
SendGetHttp(url, files_directSD_list_success, files_directSD_list_failed);
} else {
var command="";
if (target_firmware == "smoothieware") {
command = "rm " + files_currentPath + files_file_list[index].name;
} else {
command = "M30 " + files_currentPath + files_file_list[index].name;
}
SendPrinterCommand(command,true,files_proccess_and_update);
}
}
function files_proccess_and_update(answer){
document.getElementById('files_navigation_buttons').style.display="block";
if (answer.startsWith("{") && answer.endsWith("}")) {
try {
response = JSON.parse(answer);
if (typeof response.status != 'undefined') {
Monitor_output_Update(response.status + "\n");
files_error_status = response.status;
//console.log(files_error_status);
}
}
catch (e) {
console.error("Parsing error:", e);
response = "Error";
}
} else {
if (answer[answer.length-1] != '\n')Monitor_output_Update(answer + "\n");
else Monitor_output_Update(answer);
answer = answer.replace(/\n/gi,"");
answer = answer.replace(/\r/gi,"");
answer = answer.trim();
if (answer.length > 0) files_error_status = answer;
else if (files_error_status.length == 0) files_error_status = "Done";
}
//console.log("error status:" + files_error_status);
files_refreshFiles(files_currentPath);
}
function files_is_clickable(index){
var entry = files_file_list[index];
if ( entry.isdir) return true;
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))) return true;
//not yet implemented but possible with cat command ?
//if ( (target_firmware == "smoothieware") && entry.isprintable) return true;
return false;
}
function files_click_file(index){
var entry = files_file_list[index];
if ( entry.isdir) {
var path = files_currentPath + entry.name + "/";
files_refreshFiles(path, true);
return;
}
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))) {
//console.log("file on direct SD");
var url = files_currentPath.replace(primary_sd, "/SD/") + entry.sdname;
window.open(url);
return;
}
if ( target_firmware == "smoothieware" && entry.isprintable){
console.log("file on smoothie SD");
//todo use a cat command ?
return;
}
}
function files_showprintbutton(filename, isdir){
if (isdir == true) return false;
if (filename.toLowerCase().match(/\.g(code)?$/) || filename.toLowerCase().match(/\.gco(de)?$/)) return true;
return false;
}
function files_showdeletebutton(index){
//can always deleted dile or dir ?
//if /ext/ is serial it should failed as fw does not support it
//var entry = files_file_list[index];
//if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))) return true;
//if (!entry.isdir) return true;
//if ( target_firmware == "smoothieware" && files_currentPath.startsWith("/sd/")) return true
return true;
}
function files_refreshFiles(path, usecache){
var cmdpath = path;
files_currentPath = path;
if (typeof usecache === 'undefined') usecache = false;
document.getElementById('files_currentPath').innerHTML = files_currentPath;
files_file_list = [];
files_status_list = [];
files_build_display_filelist(false);
document.getElementById('files_list_loader').style.display="block";
document.getElementById('files_nav_loader').style.display="block";
//this is pure direct SD
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
if (target_firmware == "smoothieware")cmdpath = path.substring(5);
var url = "/upload?path=" + encodeURI(cmdpath);
//removeIf(production)
var response = "{\"files\":[{\"name\":\"test2.gco\",\"shortname\":\"test2.gco\",\"size\":\"992 B\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"simpl3d.gcode\",\"shortname\":\"SIMPL3~1.GCO\",\"size\":\"0 B\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"patt2.g\",\"shortname\":\"patt2.g\",\"size\":\"9.73 MB\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"myfolder\",\"shortname\":\"myfolder\",\"size\":\"-1\",\"datetime\":\"2016-08-01 18:15:00\"},{\"name\":\"wconfig.ok\",\"shortname\":\"wconfig.ok\",\"size\":\"1.10 KB\",\"datetime\":\"2017-01-06 14:35:54\"},{\"name\":\"gpl.txt\",\"shortname\":\"gpl.txt\",\"size\":\"34.98 KB\",\"datetime\":\"2017-04-17 20:22:32\"},{\"name\":\"m1.g\",\"shortname\":\"m1.g\",\"size\":\"17 B\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"m2.g\",\"shortname\":\"m2.g\",\"size\":\"17 B\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"Test4.g\",\"shortname\":\"TEST4.G\",\"size\":\"20.47 KB\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"README.md\",\"shortname\":\"README.md\",\"size\":\"11.83 KB\",\"datetime\":\"2017-04-17 20:25:08\"},{\"name\":\"test file.gcode\",\"shortname\":\"TESTFI~1.GCO\",\"size\":\"11 B\",\"datetime\":\"2000-01-01 01:00:00\"},{\"name\":\"M3.g\",\"shortname\":\"M3.g\",\"size\":\"32 B\",\"datetime\":\"2000-01-01 01:00:00\"}],\"path\":\"/\",\"total\":\"14 GB\",\"used\":\"28 MB\",\"occupation\":\"1\",\"mode\":\"direct\",\"status\":\"Ok\"}";
files_directSD_list_success(response);
return;
//endRemoveIf(production)
SendGetHttp(url, files_directSD_list_success, files_directSD_list_failed);
} else{
//use ls or M20
if (target_firmware == "smoothieware"){
//workaround as ls do not like dirname ending with /
var command = "ls -s " + files_currentPath.substr(0,files_currentPath.length - 1);
SendPrinterCommand(command, false, files_serial_ls_list_success, files_serial_ls_list_failed);
//
} else {
var command = "M20";
//to avoid to query when we already have the list
if (usecache) {
files_serial_M20_list_display();
}
else {
SendPrinterCommand(command, false, files_serial_M20_list_success, files_serial_M20_list_failed);
}
}
}
}
function files_format_size(size){
var lsize = parseInt(size);
var value=0.0;
var tsize="";
if (lsize < 1024) {
tsize = lsize +" B";
} else if(lsize < (1024 * 1024)) {
value = (lsize/1024.0);
tsize = value.toFixed(2) +" KB";
} else if(lsize < (1024 * 1024 * 1024)) {
value = ((lsize/1024.0)/1024.0);
tsize = value.toFixed(2) +" MB";
} else {
value = (((lsize/1024.0)/1024.0)/1024.0);
tsize = value.toFixed(2) +" GB";
}
return tsize;
}
function files_serial_M20_list_display(){
var path = "";
if (files_currentPath.length > 1) path = files_currentPath.substring(1);
var folderlist="";
for (var i = 0; i < files_file_list_cache.length; i++){
var file_name = files_file_list_cache[i].name;
if (file_name.startsWith(path)){
file_name = file_name.substring(path.length);
if (file_name.length > 0){
var endpos = file_name.indexOf("/");
if (endpos > -1)file_name = file_name.substring(0,endpos+1);
var isdirectory = files_file_list_cache[i].isdir;
var isprint = files_file_list_cache[i].isprintable;
//to workaround the directory is not listed on its own like in marlin
if (file_name.endsWith("/")) {
isdirectory = true;
isprint = false;
file_name = file_name.substring(0, file_name.length-1);
}
var file_entry = {name:file_name, size: files_file_list_cache[i].size, isdir: isdirectory, datetime: files_file_list_cache[i].datetime, isprintable: isprint};
var tag = "*" + file_name + "*";
if(( isdirectory && folderlist.indexOf(tag) == -1) || !isdirectory){
files_file_list.push(file_entry);
if (isdirectory){
folderlist+=tag;
}
}
}
}
}
files_build_display_filelist();
}
function files_serial_M20_list_success(response_text){
var path = "";
var tlist = response_text.split("\n");
if (files_currentPath.length > 1) path = files_currentPath.substring(1);
var folderlist="";
files_file_list_cache = [];
for (var i=0; i < tlist.length; i++){
var line = tlist[i].trim();
var isdirectory = false;
var file_name="";
var fsize="";
var d ="";
line = line.replace("\r","");
if (!((line.length == 0) || (line.indexOf("egin file list") > 0) || (line.indexOf("nd file list") > 0) || (line == "ok") || (line == "wait"))){
//for marlin
if (line.startsWith("/")){
line = line.substring(1);
}
//if directory it is ending with /
if (line.endsWith("/")) {
isdirectory = true;
file_name = line;
} else {
if ((target_firmware == "repetier") || (target_firmware == "repetier4davinci")){
var pos = line.lastIndexOf(" ");
file_name = line.substr(0,pos);
fsize = files_format_size(parseInt(line.substr(pos+1)));
} else file_name = line;
}
var isprint = files_showprintbutton(file_name,isdirectory);
var tag = "*" + file_name + "*";
var file_entry = {name:file_name, size: fsize, isdir: isdirectory, datetime: d, isprintable: isprint};
files_file_list_cache.push(file_entry);
}
}
files_serial_M20_list_display();
}
function files_serial_ls_list_success(response_text){
var tlist = response_text.split("\n");
for (var i=0; i < tlist.length; i++){
var line = tlist[i].trim();
var isdirectory = false;
var file_name="";
var fsize="";
var d =""
var command = "ls -s " + files_currentPath.substr(0,files_currentPath.length - 1);
if (line == command) continue;
if (line.length != 0){
if (line.endsWith("/")) {
isdirectory = true;
file_name = line.substring(0, line.length-1);
} else {
var pos = line.lastIndexOf(" ");
file_name = line.substr(0,pos);
fsize = files_format_size(parseInt(line.substr(pos+1)));
}
var isprint = files_showprintbutton(file_name,isdirectory);
var file_entry = {name:file_name, size: fsize, isdir: isdirectory, datetime: d, isprintable: isprint};
files_file_list.push(file_entry);
}
}
files_build_display_filelist();
}
function files_directSD_list_success(response_text){
var error = false;
var response;
document.getElementById('files_navigation_buttons').style.display="block";
try {
response = JSON.parse(response_text);
}
catch (e) {
console.error("Parsing error:", e);
error = true;
}
if(error || typeof response.status == 'undefined' ){
files_directSD_list_failed(406, translate_text_item("Wrong data"));
return;
}
files_file_list = [];
files_status_list = [];
if ( typeof response.files != 'undefined' ) {
for (var i = 0 ; i < response.files.length ; i++){
var file_name="";
var isdirectory = false;
var fsize ="";
if (response.files[i].size == "-1") isdirectory = true;
else fsize = response.files[i].size;
if (target_firmware == "marlin"){
file_name = response.files[i].shortname;
} else {
file_name = response.files[i].name;
}
var isprint = files_showprintbutton(file_name,isdirectory);
var file_entry = {name:file_name, sdname: response.files[i].name, size:fsize, isdir: isdirectory, datetime: response.files[i].datetime, isprintable: isprint};
files_file_list.push(file_entry);
}
}
var vtotal = "-1";
var vused = "-1";
var voccupation = "-1";
if ( typeof response.total != 'undefined') vtotal = response.total;
if ( typeof response.used != 'undefined') vused = response.used;
if ( typeof response.occupation != 'undefined') voccupation = response.occupation;
files_status_list.push ({status: response.status, path: response.path, used: vused, total:vtotal, occupation:voccupation});
files_build_display_filelist();
}
function files_serial_M20_list_failed(error_code, response){
document.getElementById('files_navigation_buttons').style.display="block";
alertdlg (translate_text_item("Error"), "Error " + error_code + " : " + response);
files_build_display_filelist(false);
}
function files_serial_ls_list_failed(error_code, response){
files_serial_M20_list_failed(error_code, response);
}
function files_directSD_list_failed(error_code, response){
files_serial_M20_list_failed(error_code, response);
}
function need_up_level(){
if (target_firmware == "smoothieware" && (files_currentPath == primary_sd || files_currentPath == secondary_sd)) return false;
if(files_currentPath=="/") return false;
return true;
}
function files_go_levelup(){
var tlist = files_currentPath.split("/");
var path="/";
var nb = 1;
while (nb < (tlist.length-2)){
path+=tlist[nb] + "/";
nb++;
}
files_refreshFiles(path, true);
}
function files_build_display_filelist(displaylist){
var content = "";
document.getElementById('files_uploading_msg').style.display="none";
if (typeof displaylist == 'undefined')displaylist = true;
document.getElementById('files_list_loader').style.display="none";
document.getElementById('files_nav_loader').style.display="none";
if (!displaylist){
document.getElementById('files_status_sd_status').style.display="none";
document.getElementById('files_space_sd_status').style.display="none";
document.getElementById('files_fileList').innerHTML= "";
document.getElementById('files_fileList').style.display= "none";
return;
}
if (need_up_level()){
content +="<li class='list-group-item list-group-hover' style='cursor:pointer' onclick='files_go_levelup()''>";
content +="<span >"+ get_icon_svg("level-up") + "</span>&nbsp;&nbsp;<span translate>Up...</span>";
content +="</li>";
}
files_file_list.sort(function(a, b) { return compareStrings(a.name, b.name);});
for(var index=0; index < files_file_list.length; index++){
if (files_file_list[index].isdir == false)content += files_build_file_line(index);
}
for( index=0; index < files_file_list.length; index++){
if (files_file_list[index].isdir )content += files_build_file_line(index);
}
document.getElementById('files_fileList').style.display= "block";
document.getElementById('files_fileList').innerHTML=content;
if ((files_status_list.length == 0) && (files_error_status != "")) {
files_status_list.push ({status: files_error_status, path: files_currentPath, used: "-1", total:"-1", occupation:"-1"});
}
if (files_status_list.length > 0) {
if (files_status_list[0].total != "-1") {
document.getElementById('files_sd_status_total').innerHTML = files_status_list[0].total;
document.getElementById('files_sd_status_used').innerHTML = files_status_list[0].used;
document.getElementById('files_sd_status_occupation').value = files_status_list[0].occupation;
document.getElementById('files_sd_status_percent').innerHTML = files_status_list[0].occupation;
document.getElementById('files_space_sd_status').style.display="table-row";
} else {
document.getElementById('files_space_sd_status').style.display="none";
}
if ((files_error_status != "") && ((files_status_list[0].status.toLowerCase() == "ok") || (files_status_list[0].status.length == 0))){
files_status_list[0].status = files_error_status;
}
files_error_status = "";
if (files_status_list[0].status.toLowerCase() != "ok"){
document.getElementById('files_sd_status_msg').innerHTML = translate_text_item(files_status_list[0].status);
document.getElementById('files_status_sd_status').style.display="table-row";
} else {
document.getElementById('files_status_sd_status').style.display="none";
}
} else document.getElementById('files_space_sd_status').style.display="none";
}
function files_progress(){
var command = "progress";
if (target_firmware != "smoothieware")command = "M27";
SendPrinterCommand(command);
}
function files_abort(){
var command = "abort";
if (target_firmware != "smoothieware"){
if (target_firmware == "marlin"){
command = "M108\nM108\nM108\nM112";
} else command = "M112";
}
SendPrinterCommand(command);
}
function files_select_upload(){
document.getElementById('files_input_file').click();
}
function files_check_if_upload(){
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
SendPrinterCommand("[ESP200]", false, process_check_sd_presence );
} else {
//try ls
if ( target_firmware == "smoothieware" ){
var cmd="ls "+ files_currentPath;
SendPrinterCommand(cmd, false,process_check_sd_presence );
}else {//no reliable way to know SD is present or not so let's upload
files_start_upload();
}
}
}
function process_check_sd_presence(answer){
//console.log(answer);
//for direct SD there is a SD check
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
if (answer.indexOf("o SD card") >-1){
alertdlg (translate_text_item("Upload failed"), translate_text_item("No SD card detected"));
files_error_status ="No SD card"
files_build_display_filelist(false);
document.getElementById('files_sd_status_msg').innerHTML = files_error_status;
document.getElementById('files_status_sd_status').style.display="table-row";
} else files_start_upload();
} else { //for smoothiware ls say no directory
if ( target_firmware == "smoothieware" ){
if (answer.indexOf("ould not open directory") >-1){
alertdlg (translate_text_item("Upload failed"), translate_text_item("No SD card detected"));
files_error_status ="No SD card"
files_build_display_filelist(false);
document.getElementById('files_sd_status_msg').innerHTML = files_error_status;
document.getElementById('files_status_sd_status').style.display="table-row";
} else files_start_upload();
} else files_start_upload();
}
//no check for marlin / repetier as no reliable test IFAIK
}
function files_start_upload(){
if (http_communication_locked) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Communications are currently locked, please wait and retry."));
console.log("communication locked");
return;
}
var url = "/upload";
var path = files_currentPath;
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
path = files_currentPath.substring(primary_sd.length);
}
if (!direct_sd || ( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
url = "/upload_serial";
if (target_firmware == "smoothieware" ) {
if (files_currentPath.startsWith(secondary_sd)) path = files_currentPath.substring(secondary_sd.length);
else path = files_currentPath.substring(primary_sd.length);
}
}
//console.log("upload from " + path );
var files = document.getElementById("files_input_file").files;
if (files.value == "" || typeof files[0].name === 'undefined') {
console.log("nothing to upload");
return;
}
var formData = new FormData();
formData.append('path', path);
for (var i = 0; i < files.length; i++) {
var file = files[i];
formData.append('myfile[]', file, path + file.name);
//console.log( path +file.name);
}
files_error_status = "Upload " +file.name;
document.getElementById('files_currentUpload_msg').innerHTML = file.name;
document.getElementById('files_uploading_msg').style.display="block";
document.getElementById('files_navigation_buttons').style.display="none";
if (direct_sd && !( target_firmware == "smoothieware" && files_currentPath.startsWith(secondary_sd))){
SendFileHttp(url, formData, FilesUploadProgressDisplay, files_directSD_list_success, files_directSD_list_failed);
//console.log("send file");
} else {
SendFileHttp(url, formData, FilesUploadProgressDisplay, files_proccess_and_update, files_serial_M20_list_failed);
}
document.getElementById("files_input_file").value="";
}
function FilesUploadProgressDisplay(oEvent){
if (oEvent.lengthComputable) {
var percentComplete = (oEvent.loaded / oEvent.total)*100;
document.getElementById('files_prg').value=percentComplete;
document.getElementById('files_percent_upload').innerHTML = percentComplete.toFixed(0);
} else {
// Impossible because size is unknown
}
}

70
www/js/http.js Normal file
View File

@@ -0,0 +1,70 @@
var http_communication_locked = false;
function SendGetHttp(url, resultfn, errorfn){
if (http_communication_locked) {
errorfn(503, translate_text_item("Communication locked!"));
return;
}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200 )
{
if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText);
}
else {
if (typeof errorfn != 'undefined' && errorfn != null )errorfn(xmlhttp.status, xmlhttp.responseText);
}
}
}
//console.log(url);
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
function SendPostHttp(url, postdata,resultfn, errorfn){
if (http_communication_locked) {
errorfn(503, translate_text_item("Communication locked!"));
return;
}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200 )
{
if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText);
}
else {
if (typeof errorfn != 'undefined' && errorfn != null)errorfn(xmlhttp.status, xmlhttp.responseText);
}
}
}
//console.log(url);
xmlhttp.open("POST", url, true);
xmlhttp.send(postdata);
}
function SendFileHttp(url, postdata, progressfn,resultfn, errorfn){
if (http_communication_locked) {
errorfn(503, translate_text_item("Communication locked!"));
return;
}
http_communication_locked = true;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
http_communication_locked = false;
if (xmlhttp.status == 200 )
{
if (typeof resultfn != 'undefined' && resultfn != null )resultfn(xmlhttp.responseText);
}
else {
if (typeof errorfn != 'undefined' && errorfn != null)errorfn(xmlhttp.status, xmlhttp.responseText);
}
}
}
//console.log(url);
xmlhttp.open("POST", url, true);
if (typeof progressfn !='undefined' && progressfn != null)xmlhttp.upload.addEventListener("progress", progressfn, false);
xmlhttp.send(postdata);
}

172
www/js/icons.js Normal file
View File

@@ -0,0 +1,172 @@
//bootstrap icons
var list_icon = {"hourglass":"M1000 1200v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-50v-100q0 -91 -49.5 -165.5t-130.5 -109.5q81 -35 130.5 -109.5t49.5 -165.5v-150h50q21 0 35.5 -14.5t14.5 -35.5v-150h-800v150q0 21 14.5 35.5t35.5 14.5h50v150q0 91 49.5 165.5t130.5 109.5q-81 35 -130.5 109.5 t-49.5 165.5v100h-50q-21 0 -35.5 14.5t-14.5 35.5v150h800zM400 1000v-100q0 -60 32.5 -109.5t87.5 -73.5q28 -12 44 -37t16 -55t-16 -55t-44 -37q-55 -24 -87.5 -73.5t-32.5 -109.5v-150h400v150q0 60 -32.5 109.5t-87.5 73.5q-28 12 -44 37t-16 55t16 55t44 37 q55 24 87.5 73.5t32.5 109.5v100h-400z",
"cloud":"M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -206.5q0 -121 -85 -207.5t-205 -86.5h-750q-79 0 -135.5 57t-56.5 137q0 69 42.5 122.5t108.5 67.5q-2 12 -2 37q0 153 108 260.5t260 107.5z",
"envelope":"M25 1100h1150q10 0 12.5 -5t-5.5 -13l-564 -567q-8 -8 -18 -8t-18 8l-564 567q-8 8 -5.5 13t12.5 5zM18 882l264 -264q8 -8 8 -18t-8 -18l-264 -264q-8 -8 -13 -5.5t-5 12.5v550q0 10 5 12.5t13 -5.5zM918 618l264 264q8 8 13 5.5t5 -12.5v-550q0 -10 -5 -12.5t-13 5.5 l-264 264q-8 8 -8 18t8 18zM818 482l364 -364q8 -8 5.5 -13t-12.5 -5h-1150q-10 0 -12.5 5t5.5 13l364 364q8 8 18 8t18 -8l164 -164q8 -8 18 -8t18 8l164 164q8 8 18 8t18 -8z",
"pencil":"M1011 1210q19 0 33 -13l153 -153q13 -14 13 -33t-13 -33l-99 -92l-214 214l95 96q13 14 32 14zM1013 800l-615 -614l-214 214l614 614zM317 96l-333 -112l110 335z",
"music":"M368 1017l645 163q39 15 63 0t24 -49v-831q0 -55 -41.5 -95.5t-111.5 -63.5q-79 -25 -147 -4.5t-86 75t25.5 111.5t122.5 82q72 24 138 8v521l-600 -155v-606q0 -42 -44 -90t-109 -69q-79 -26 -147 -5.5t-86 75.5t25.5 111.5t122.5 82.5q72 24 138 7v639q0 38 14.5 59 t53.5 34z",
"search":"M500 1191q100 0 191 -39t156.5 -104.5t104.5 -156.5t39 -191l-1 -2l1 -5q0 -141 -78 -262l275 -274q23 -26 22.5 -44.5t-22.5 -42.5l-59 -58q-26 -20 -46.5 -20t-39.5 20l-275 274q-119 -77 -261 -77l-5 1l-2 -1q-100 0 -191 39t-156.5 104.5t-104.5 156.5t-39 191 t39 191t104.5 156.5t156.5 104.5t191 39zM500 1022q-88 0 -162 -43t-117 -117t-43 -162t43 -162t117 -117t162 -43t162 43t117 117t43 162t-43 162t-117 117t-162 43z",
"heart":"M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104z",
"star":"M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429z",
"star-empty":"M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429zM477 700h-240l197 -142l-74 -226 l193 139l195 -140l-74 229l192 140h-234l-78 211z",
"user":"M600 1200q124 0 212 -88t88 -212v-250q0 -46 -31 -98t-69 -52v-75q0 -10 6 -21.5t15 -17.5l358 -230q9 -5 15 -16.5t6 -21.5v-93q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v93q0 10 6 21.5t15 16.5l358 230q9 6 15 17.5t6 21.5v75q-38 0 -69 52 t-31 98v250q0 124 88 212t212 88z",
"th-large":"M50 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM50 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z",
"th":"M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM850 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 700h200q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5 t35.5 14.5z",
"th-list":"M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h700q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z",
"ok":"M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z",
"remove":"M904 1083l178 -179q8 -8 8 -18.5t-8 -17.5l-267 -268l267 -268q8 -7 8 -17.5t-8 -18.5l-178 -178q-8 -8 -18.5 -8t-17.5 8l-268 267l-268 -267q-7 -8 -17.5 -8t-18.5 8l-178 178q-8 8 -8 18.5t8 17.5l267 268l-267 268q-8 7 -8 17.5t8 18.5l178 178q8 8 18.5 8t17.5 -8 l268 -267l268 268q7 7 17.5 7t18.5 -7z",
"zoom-in":"M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM425 900h150q10 0 17.5 -7.5t7.5 -17.5v-75h75q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5 t-17.5 -7.5h-75v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-75q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v75q0 10 7.5 17.5t17.5 7.5z",
"zoom-out":"M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM325 800h350q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-350q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z",
"off":"M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z",
"signal":"M1025 1200h150q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM725 800h150q10 0 17.5 -7.5t7.5 -17.5v-750q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v750 q0 10 7.5 17.5t17.5 7.5zM425 500h150q10 0 17.5 -7.5t7.5 -17.5v-450q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v450q0 10 7.5 17.5t17.5 7.5zM125 300h150q10 0 17.5 -7.5t7.5 -17.5v-250q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5 v250q0 10 7.5 17.5t17.5 7.5z",
"cog":"M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z",
"trash":"M500 1300h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-75h-1100v75q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5zM500 1200v-100h300v100h-300zM1100 900v-800q0 -41 -29.5 -70.5t-70.5 -29.5h-700q-41 0 -70.5 29.5t-29.5 70.5 v800h900zM300 800v-700h100v700h-100zM500 800v-700h100v700h-100zM700 800v-700h100v700h-100zM900 800v-700h100v700h-100z",
"home":"M18 618l620 608q8 7 18.5 7t17.5 -7l608 -608q8 -8 5.5 -13t-12.5 -5h-175v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v375h-300v-375q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v575h-175q-10 0 -12.5 5t5.5 13z",
"file":"M600 1200v-400q0 -41 29.5 -70.5t70.5 -29.5h300v-650q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5h450zM1000 800h-250q-21 0 -35.5 14.5t-14.5 35.5v250z",
"time":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h50q10 0 17.5 -7.5t7.5 -17.5v-275h175q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5z",
"download-alt":"M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-450h191q20 0 25.5 -11.5t-7.5 -27.5l-327 -400q-13 -16 -32 -16t-32 16l-327 400q-13 16 -7.5 27.5t25.5 11.5h191v450q0 21 14.5 35.5t35.5 14.5zM1125 400h50q10 0 17.5 -7.5t7.5 -17.5v-350q0 -10 -7.5 -17.5t-17.5 -7.5 h-1050q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h50q10 0 17.5 -7.5t7.5 -17.5v-175h900v175q0 10 7.5 17.5t17.5 7.5z",
"download":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -275q-13 -16 -32 -16t-32 16l-223 275q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z ",
"upload":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM632 914l223 -275q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5l223 275q13 16 32 16 t32 -16z",
"inbox":"M225 1200h750q10 0 19.5 -7t12.5 -17l186 -652q7 -24 7 -49v-425q0 -12 -4 -27t-9 -17q-12 -6 -37 -6h-1100q-12 0 -27 4t-17 8q-6 13 -6 38l1 425q0 25 7 49l185 652q3 10 12.5 17t19.5 7zM878 1000h-556q-10 0 -19 -7t-11 -18l-87 -450q-2 -11 4 -18t16 -7h150 q10 0 19.5 -7t11.5 -17l38 -152q2 -10 11.5 -17t19.5 -7h250q10 0 19.5 7t11.5 17l38 152q2 10 11.5 17t19.5 7h150q10 0 16 7t4 18l-87 450q-2 11 -11 18t-19 7z",
"play-circle":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM540 820l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z",
"repeat":"M947 1060l135 135q7 7 12.5 5t5.5 -13v-362q0 -10 -7.5 -17.5t-17.5 -7.5h-362q-11 0 -13 5.5t5 12.5l133 133q-109 76 -238 76q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5h150q0 -117 -45.5 -224 t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117z",
"refresh":"M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z",
"list-alt":"M125 1200h1050q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-1050q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM1075 1000h-850q-10 0 -17.5 -7.5t-7.5 -17.5v-850q0 -10 7.5 -17.5t17.5 -7.5h850q10 0 17.5 7.5t7.5 17.5v850 q0 10 -7.5 17.5t-17.5 7.5zM325 900h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 900h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 700h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 700h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 500h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 500h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 300h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 300h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5z",
"lock":"M900 800v200q0 83 -58.5 141.5t-141.5 58.5h-300q-82 0 -141 -59t-59 -141v-200h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h900q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-100zM400 800v150q0 21 15 35.5t35 14.5h200 q20 0 35 -14.5t15 -35.5v-150h-300z",
"flag":"M125 1100h50q10 0 17.5 -7.5t7.5 -17.5v-1075h-100v1075q0 10 7.5 17.5t17.5 7.5zM1075 1052q4 0 9 -2q16 -6 16 -23v-421q0 -6 -3 -12q-33 -59 -66.5 -99t-65.5 -58t-56.5 -24.5t-52.5 -6.5q-26 0 -57.5 6.5t-52.5 13.5t-60 21q-41 15 -63 22.5t-57.5 15t-65.5 7.5 q-85 0 -160 -57q-7 -5 -15 -5q-6 0 -11 3q-14 7 -14 22v438q22 55 82 98.5t119 46.5q23 2 43 0.5t43 -7t32.5 -8.5t38 -13t32.5 -11q41 -14 63.5 -21t57 -14t63.5 -7q103 0 183 87q7 8 18 8z",
"volume-off":"M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM900 668l120 120q7 7 17 7t17 -7l34 -34q7 -7 7 -17t-7 -17l-120 -120l120 -120q7 -7 7 -17 t-7 -17l-34 -34q-7 -7 -17 -7t-17 7l-120 119l-120 -119q-7 -7 -17 -7t-17 7l-34 34q-7 7 -7 17t7 17l119 120l-119 120q-7 7 -7 17t7 17l34 34q7 8 17 8t17 -8z",
"volume-down":"M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6 l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238q-6 8 -4.5 18t9.5 17l29 22q7 5 15 5z",
"volume-up":"M967 1004h3q11 -1 17 -10q135 -179 135 -396q0 -105 -34 -206.5t-98 -185.5q-7 -9 -17 -10h-3q-9 0 -16 6l-42 34q-8 6 -9 16t5 18q111 150 111 328q0 90 -29.5 176t-84.5 157q-6 9 -5 19t10 16l42 33q7 5 15 5zM321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5 t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238 q-6 8 -4.5 18.5t9.5 16.5l29 22q7 5 15 5z",
"tag":"M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z",
"print":"M822 1200h-444q-11 0 -19 -7.5t-9 -17.5l-78 -301q-7 -24 7 -45l57 -108q6 -9 17.5 -15t21.5 -6h450q10 0 21.5 6t17.5 15l62 108q14 21 7 45l-83 301q-1 10 -9 17.5t-19 7.5zM1175 800h-150q-10 0 -21 -6.5t-15 -15.5l-78 -156q-4 -9 -15 -15.5t-21 -6.5h-550 q-10 0 -21 6.5t-15 15.5l-78 156q-4 9 -15 15.5t-21 6.5h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-650q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h750q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5 t7.5 17.5v650q0 10 -7.5 17.5t-17.5 7.5zM850 200h-500q-10 0 -19.5 -7t-11.5 -17l-38 -152q-2 -10 3.5 -17t15.5 -7h600q10 0 15.5 7t3.5 17l-38 152q-2 10 -11.5 17t-19.5 7z",
"camera":"M500 1100h200q56 0 102.5 -20.5t72.5 -50t44 -59t25 -50.5l6 -20h150q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5h150q2 8 6.5 21.5t24 48t45 61t72 48t102.5 21.5zM900 800v-100 h100v100h-100zM600 730q-95 0 -162.5 -67.5t-67.5 -162.5t67.5 -162.5t162.5 -67.5t162.5 67.5t67.5 162.5t-67.5 162.5t-162.5 67.5zM600 603q43 0 73 -30t30 -73t-30 -73t-73 -30t-73 30t-30 73t30 73t73 30z",
"align-justify":"M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z",
"facetime-video":"M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z",
"picture":"M44 1100h1112q18 0 31 -13t13 -31v-1012q0 -18 -13 -31t-31 -13h-1112q-18 0 -31 13t-13 31v1012q0 18 13 31t31 13zM100 1000v-737l247 182l298 -131l-74 156l293 318l236 -288v500h-1000zM342 884q56 0 95 -39t39 -94.5t-39 -95t-95 -39.5t-95 39.5t-39 95t39 94.5 t95 39z",
"map-maker":"M648 1169q117 0 216 -60t156.5 -161t57.5 -218q0 -115 -70 -258q-69 -109 -158 -225.5t-143 -179.5l-54 -62q-9 8 -25.5 24.5t-63.5 67.5t-91 103t-98.5 128t-95.5 148q-60 132 -60 249q0 88 34 169.5t91.5 142t137 96.5t166.5 36zM652.5 974q-91.5 0 -156.5 -65 t-65 -157t65 -156.5t156.5 -64.5t156.5 64.5t65 156.5t-65 157t-156.5 65z",
"adjust":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 173v854q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57z",
"tint":"M554 1295q21 -72 57.5 -143.5t76 -130t83 -118t82.5 -117t70 -116t49.5 -126t18.5 -136.5q0 -71 -25.5 -135t-68.5 -111t-99 -82t-118.5 -54t-125.5 -23q-84 5 -161.5 34t-139.5 78.5t-99 125t-37 164.5q0 69 18 136.5t49.5 126.5t69.5 116.5t81.5 117.5t83.5 119 t76.5 131t58.5 143zM344 710q-23 -33 -43.5 -70.5t-40.5 -102.5t-17 -123q1 -37 14.5 -69.5t30 -52t41 -37t38.5 -24.5t33 -15q21 -7 32 -1t13 22l6 34q2 10 -2.5 22t-13.5 19q-5 4 -14 12t-29.5 40.5t-32.5 73.5q-26 89 6 271q2 11 -6 11q-8 1 -15 -10z",
"edit":"M1000 1013l108 115q2 1 5 2t13 2t20.5 -1t25 -9.5t28.5 -21.5q22 -22 27 -43t0 -32l-6 -10l-108 -115zM350 1100h400q50 0 105 -13l-187 -187h-368q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v182l200 200v-332 q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM1009 803l-362 -362l-161 -50l55 170l355 355z",
"share":"M350 1100h361q-164 -146 -216 -200h-195q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-103q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M824 1073l339 -301q8 -7 8 -17.5t-8 -17.5l-340 -306q-7 -6 -12.5 -4t-6.5 11v203q-26 1 -54.5 0t-78.5 -7.5t-92 -17.5t-86 -35t-70 -57q10 59 33 108t51.5 81.5t65 58.5t68.5 40.5t67 24.5t56 13.5t40 4.5v210q1 10 6.5 12.5t13.5 -4.5z",
"check":"M350 1100h350q60 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-219q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M643 639l395 395q7 7 17.5 7t17.5 -7l101 -101q7 -7 7 -17.5t-7 -17.5l-531 -532q-7 -7 -17.5 -7t-17.5 7l-248 248q-7 7 -7 17.5t7 17.5l101 101q7 7 17.5 7t17.5 -7l111 -111q8 -7 18 -7t18 7z",
"move":"M318 918l264 264q8 8 18 8t18 -8l260 -264q7 -8 4.5 -13t-12.5 -5h-170v-200h200v173q0 10 5 12t13 -5l264 -260q8 -7 8 -17.5t-8 -17.5l-264 -265q-8 -7 -13 -5t-5 12v173h-200v-200h170q10 0 12.5 -5t-4.5 -13l-260 -264q-8 -8 -18 -8t-18 8l-264 264q-8 8 -5.5 13 t12.5 5h175v200h-200v-173q0 -10 -5 -12t-13 5l-264 265q-8 7 -8 17.5t8 17.5l264 260q8 7 13 5t5 -12v-173h200v200h-175q-10 0 -12.5 5t5.5 13z",
"step-backward":"M250 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z",
"fast-backward":"M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5 t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z",
"backward":"M1200 1050v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-492 480q-15 14 -15 35t15 35l492 480q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25z",
"play":"M243 1074l814 -498q18 -11 18 -26t-18 -26l-814 -498q-18 -11 -30.5 -4t-12.5 28v1000q0 21 12.5 28t30.5 -4z",
"pause":"M250 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM650 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800 q0 21 14.5 35.5t35.5 14.5z",
"stop":"M1100 950v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5z",
"forward":"M500 612v438q0 21 10.5 25t25.5 -10l492 -480q15 -14 15 -35t-15 -35l-492 -480q-15 -14 -25.5 -10t-10.5 25v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10z",
"fast-forward":"M1048 1102l100 1q20 0 35 -14.5t15 -35.5l5 -1000q0 -21 -14.5 -35.5t-35.5 -14.5l-100 -1q-21 0 -35.5 14.5t-14.5 35.5l-2 437l-463 -454q-14 -15 -24.5 -10.5t-10.5 25.5l-2 437l-462 -455q-15 -14 -25.5 -9.5t-10.5 24.5l-5 1000q0 21 10.5 25.5t25.5 -10.5l466 -450 l-2 438q0 20 10.5 24.5t25.5 -9.5l466 -451l-2 438q0 21 14.5 35.5t35.5 14.5z",
"step-forward":"M850 1100h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10l464 -453v438q0 21 14.5 35.5t35.5 14.5z",
"eject":"M686 1081l501 -540q15 -15 10.5 -26t-26.5 -11h-1042q-22 0 -26.5 11t10.5 26l501 540q15 15 36 15t36 -15zM150 400h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z",
"key":"M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z",
"exit":"M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z",
"plus-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM650 900h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-150 q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5h150v-150q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v150h150q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-150v150q0 21 -14.5 35.5t-35.5 14.5z",
"minus-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM850 700h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5 t35.5 -14.5h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5z",
"remove-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM741.5 913q-12.5 0 -21.5 -9l-120 -120l-120 120q-9 9 -21.5 9 t-21.5 -9l-141 -141q-9 -9 -9 -21.5t9 -21.5l120 -120l-120 -120q-9 -9 -9 -21.5t9 -21.5l141 -141q9 -9 21.5 -9t21.5 9l120 120l120 -120q9 -9 21.5 -9t21.5 9l141 141q9 9 9 21.5t-9 21.5l-120 120l120 120q9 9 9 21.5t-9 21.5l-141 141q-9 9 -21.5 9z",
"ok-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM546 623l-84 85q-7 7 -17.5 7t-18.5 -7l-139 -139q-7 -8 -7 -18t7 -18 l242 -241q7 -8 17.5 -8t17.5 8l375 375q7 7 7 17.5t-7 18.5l-139 139q-7 7 -17.5 7t-17.5 -7z",
"question-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM588 941q-29 0 -59 -5.5t-63 -20.5t-58 -38.5t-41.5 -63t-16.5 -89.5 q0 -25 20 -25h131q30 -5 35 11q6 20 20.5 28t45.5 8q20 0 31.5 -10.5t11.5 -28.5q0 -23 -7 -34t-26 -18q-1 0 -13.5 -4t-19.5 -7.5t-20 -10.5t-22 -17t-18.5 -24t-15.5 -35t-8 -46q-1 -8 5.5 -16.5t20.5 -8.5h173q7 0 22 8t35 28t37.5 48t29.5 74t12 100q0 47 -17 83 t-42.5 57t-59.5 34.5t-64 18t-59 4.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z",
"info-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM675 1000h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5 t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5zM675 700h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h75v-200h-75q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h350q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5 t-17.5 7.5h-75v275q0 10 -7.5 17.5t-17.5 7.5z",
"screenshot":"M525 1200h150q10 0 17.5 -7.5t7.5 -17.5v-194q103 -27 178.5 -102.5t102.5 -178.5h194q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-194q-27 -103 -102.5 -178.5t-178.5 -102.5v-194q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v194 q-103 27 -178.5 102.5t-102.5 178.5h-194q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h194q27 103 102.5 178.5t178.5 102.5v194q0 10 7.5 17.5t17.5 7.5zM700 893v-168q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v168q-68 -23 -119 -74 t-74 -119h168q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-168q23 -68 74 -119t119 -74v168q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-168q68 23 119 74t74 119h-168q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h168 q-23 68 -74 119t-119 74z",
"remove-circle":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM759 823l64 -64q7 -7 7 -17.5t-7 -17.5l-124 -124l124 -124q7 -7 7 -17.5t-7 -17.5l-64 -64q-7 -7 -17.5 -7t-17.5 7l-124 124l-124 -124q-7 -7 -17.5 -7t-17.5 7l-64 64 q-7 7 -7 17.5t7 17.5l124 124l-124 124q-7 7 -7 17.5t7 17.5l64 64q7 7 17.5 7t17.5 -7l124 -124l124 124q7 7 17.5 7t17.5 -7z",
"ok-circle":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM782 788l106 -106q7 -7 7 -17.5t-7 -17.5l-320 -321q-8 -7 -18 -7t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l197 197q7 7 17.5 7t17.5 -7z",
"ban-circle":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5q0 -120 65 -225 l587 587q-105 65 -225 65zM965 819l-584 -584q104 -62 219 -62q116 0 214.5 57t155.5 155.5t57 214.5q0 115 -62 219z",
"arrow-left":"M39 582l522 427q16 13 27.5 8t11.5 -26v-291h550q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-550v-291q0 -21 -11.5 -26t-27.5 8l-522 427q-16 13 -16 32t16 32z",
"arrow-right":"M639 1009l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291h-550q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h550v291q0 21 11.5 26t27.5 -8z",
"arrow-up":"M682 1161l427 -522q13 -16 8 -27.5t-26 -11.5h-291v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v550h-291q-21 0 -26 11.5t8 27.5l427 522q13 16 32 16t32 -16z",
"arrow-down":"M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-550h291q21 0 26 -11.5t-8 -27.5l-427 -522q-13 -16 -32 -16t-32 16l-427 522q-13 16 -8 27.5t26 11.5h291v550q0 21 14.5 35.5t35.5 14.5z",
"share-alt":"M639 1109l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291q-94 -2 -182 -20t-170.5 -52t-147 -92.5t-100.5 -135.5q5 105 27 193.5t67.5 167t113 135t167 91.5t225.5 42v262q0 21 11.5 26t27.5 -8z",
"resize-full":"M850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5zM350 0h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249 q8 7 18 7t18 -7l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5z",
"resize-small":"M1014 1120l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249q8 7 18 7t18 -7zM250 600h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5z",
"exclamation-sign":"M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM704 900h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5 t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z",
"fire":"M653 1231q-39 -67 -54.5 -131t-10.5 -114.5t24.5 -96.5t47.5 -80t63.5 -62.5t68.5 -46.5t65 -30q-4 7 -17.5 35t-18.5 39.5t-17 39.5t-17 43t-13 42t-9.5 44.5t-2 42t4 43t13.5 39t23 38.5q96 -42 165 -107.5t105 -138t52 -156t13 -159t-19 -149.5q-13 -55 -44 -106.5 t-68 -87t-78.5 -64.5t-72.5 -45t-53 -22q-72 -22 -127 -11q-31 6 -13 19q6 3 17 7q13 5 32.5 21t41 44t38.5 63.5t21.5 81.5t-6.5 94.5t-50 107t-104 115.5q10 -104 -0.5 -189t-37 -140.5t-65 -93t-84 -52t-93.5 -11t-95 24.5q-80 36 -131.5 114t-53.5 171q-2 23 0 49.5 t4.5 52.5t13.5 56t27.5 60t46 64.5t69.5 68.5q-8 -53 -5 -102.5t17.5 -90t34 -68.5t44.5 -39t49 -2q31 13 38.5 36t-4.5 55t-29 64.5t-36 75t-26 75.5q-15 85 2 161.5t53.5 128.5t85.5 92.5t93.5 61t81.5 25.5z",
"eye-open":"M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z",
"eye-close":"M592 0h-148l31 120q-91 20 -175.5 68.5t-143.5 106.5t-103.5 119t-66.5 110t-22 76q0 21 14 57.5t42.5 82.5t68 95t94.5 95t116.5 82.5t140 59t160.5 22.5q61 0 126 -15l32 121h148zM944 770l47 181q108 -85 176.5 -192t68.5 -159q0 -26 -19.5 -71t-59.5 -102t-93 -112 t-129 -104.5t-158 -75.5l46 173q77 49 136 117t97 131q11 18 9 42.5t-14 41.5q-54 70 -107 130zM310 824q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q18 -30 39 -60t57 -70.5t74 -73t90 -61t105 -41.5l41 154q-107 18 -178.5 101.5t-71.5 193.5q0 59 23 114q8 19 4.5 22 t-17.5 -12zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l12 11l22 86l-3 4q-44 44 -89 117q-11 18 -28 20t-32 -12z",
"warning-sign":"M-90 100l642 1066q20 31 48 28.5t48 -35.5l642 -1056q21 -32 7.5 -67.5t-50.5 -35.5h-1294q-37 0 -50.5 34t7.5 66zM155 200h345v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h345l-445 723zM496 700h208q20 0 32 -14.5t8 -34.5l-58 -252 q-4 -20 -21.5 -34.5t-37.5 -14.5h-54q-20 0 -37.5 14.5t-21.5 34.5l-58 252q-4 20 8 34.5t32 14.5z",
"shopping-cart":"M56 1200h94q17 0 31 -11t18 -27l38 -162h896q24 0 39 -18.5t10 -42.5l-100 -475q-5 -21 -27 -42.5t-55 -21.5h-633l48 -200h535q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-50q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-300v-50 q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-31q-18 0 -32.5 10t-20.5 19l-5 10l-201 961h-54q-20 0 -35 14.5t-15 35.5t15 35.5t35 14.5z",
"folder-close":"M1200 1000v-100h-1200v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500zM0 800h1200v-800h-1200v800z",
"folder-open":"M200 800l-200 -400v600h200q0 41 29.5 70.5t70.5 29.5h300q42 0 71 -29.5t29 -70.5h500v-200h-1000zM1500 700l-300 -700h-1200l300 700h1200z",
"resize-vertical":"M635 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-601h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v601h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z",
"resize-horizontal":"M936 864l249 -229q14 -15 14 -35.5t-14 -35.5l-249 -229q-15 -15 -25.5 -10.5t-10.5 24.5v151h-600v-151q0 -20 -10.5 -24.5t-25.5 10.5l-249 229q-14 15 -14 35.5t14 35.5l249 229q15 15 25.5 10.5t10.5 -25.5v-149h600v149q0 21 10.5 25.5t25.5 -10.5z",
"hdd":"M1169 400l-172 732q-5 23 -23 45.5t-38 22.5h-672q-20 0 -38 -20t-23 -41l-172 -739h1138zM1100 300h-1000q-41 0 -70.5 -29.5t-29.5 -70.5v-100q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v100q0 41 -29.5 70.5t-70.5 29.5zM800 100v100h100v-100h-100 zM1000 100v100h100v-100h-100z",
"bell":"M553 1200h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q19 0 33 -14.5t14 -35t-13 -40.5t-31 -27q-8 -4 -23 -9.5t-65 -19.5t-103 -25t-132.5 -20t-158.5 -9q-57 0 -115 5t-104 12t-88.5 15.5t-73.5 17.5t-54.5 16t-35.5 12l-11 4 q-18 8 -31 28t-13 40.5t14 35t33 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3.5 32t28.5 13zM498 110q50 -6 102 -6q53 0 102 6q-12 -49 -39.5 -79.5t-62.5 -30.5t-63 30.5t-39 79.5z",
"certificate":"M800 946l224 78l-78 -224l234 -45l-180 -155l180 -155l-234 -45l78 -224l-224 78l-45 -234l-155 180l-155 -180l-45 234l-224 -78l78 224l-234 45l180 155l-180 155l234 45l-78 224l224 -78l45 234l155 -180l155 180z",
"thumbs-up":"M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z",
"thumbs-down":"M600 1100h250q23 0 45 -16.5t38 -40.5l238 -344q29 -29 29 -74v-100q0 -44 -30 -84.5t-70 -40.5h-328q28 -118 28 -125v-150q0 -44 -30 -84.5t-70 -40.5h-50q-27 0 -51.5 20t-37.5 48l-96 198l-145 196q-20 27 -20 63v400q0 39 27.5 57t72.5 18h61q124 100 139 100z M50 1000h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM636 1000l-136 -100h-100v-375l150 -213l100 -212h50v175l-50 225h450v125l-250 375h-214z",
"hand-right":"M356 873l363 230q31 16 53 -6l110 -112q13 -13 13.5 -32t-11.5 -34l-84 -121h302q84 0 138 -38t54 -110t-55 -111t-139 -39h-106l-131 -339q-6 -21 -19.5 -41t-28.5 -20h-342q-7 0 -90 81t-83 94v525q0 17 14 35.5t28 28.5zM400 792v-503l100 -89h293l131 339 q6 21 19.5 41t28.5 20h203q21 0 30.5 25t0.5 50t-31 25h-456h-7h-6h-5.5t-6 0.5t-5 1.5t-5 2t-4 2.5t-4 4t-2.5 4.5q-12 25 5 47l146 183l-86 83zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500 q0 21 14.5 35.5t35.5 14.5z",
"hand-left":"M475 1103l366 -230q2 -1 6 -3.5t14 -10.5t18 -16.5t14.5 -20t6.5 -22.5v-525q0 -13 -86 -94t-93 -81h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-85 0 -139.5 39t-54.5 111t54 110t138 38h302l-85 121q-11 15 -10.5 34t13.5 32l110 112q22 22 53 6zM370 945l146 -183 q17 -22 5 -47q-2 -2 -3.5 -4.5t-4 -4t-4 -2.5t-5 -2t-5 -1.5t-6 -0.5h-6h-6.5h-6h-475v-100h221q15 0 29 -20t20 -41l130 -339h294l106 89v503l-342 236zM1050 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5 v500q0 21 14.5 35.5t35.5 14.5z",
"hand-up":"M550 1294q72 0 111 -55t39 -139v-106l339 -131q21 -6 41 -19.5t20 -28.5v-342q0 -7 -81 -90t-94 -83h-525q-17 0 -35.5 14t-28.5 28l-9 14l-230 363q-16 31 6 53l112 110q13 13 32 13.5t34 -11.5l121 -84v302q0 84 38 138t110 54zM600 972v203q0 21 -25 30.5t-50 0.5 t-25 -31v-456v-7v-6v-5.5t-0.5 -6t-1.5 -5t-2 -5t-2.5 -4t-4 -4t-4.5 -2.5q-25 -12 -47 5l-183 146l-83 -86l236 -339h503l89 100v293l-339 131q-21 6 -41 19.5t-20 28.5zM450 200h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z",
"hand-down":"M350 1100h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5zM600 306v-106q0 -84 -39 -139t-111 -55t-110 54t-38 138v302l-121 -84q-15 -12 -34 -11.5t-32 13.5l-112 110 q-22 22 -6 53l230 363q1 2 3.5 6t10.5 13.5t16.5 17t20 13.5t22.5 6h525q13 0 94 -83t81 -90v-342q0 -15 -20 -28.5t-41 -19.5zM308 900l-236 -339l83 -86l183 146q22 17 47 5q2 -1 4.5 -2.5t4 -4t2.5 -4t2 -5t1.5 -5t0.5 -6v-5.5v-6v-7v-456q0 -22 25 -31t50 0.5t25 30.5 v203q0 15 20 28.5t41 19.5l339 131v293l-89 100h-503z",
"circle-arrow-right":"M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM914 632l-275 223q-16 13 -27.5 8t-11.5 -26v-137h-275 q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h275v-137q0 -21 11.5 -26t27.5 8l275 223q16 13 16 32t-16 32z",
"circle-arrow-left":"M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM561 855l-275 -223q-16 -13 -16 -32t16 -32l275 -223q16 -13 27.5 -8 t11.5 26v137h275q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5h-275v137q0 21 -11.5 26t-27.5 -8z",
"circle-arrow-up":"M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM855 639l-223 275q-13 16 -32 16t-32 -16l-223 -275q-13 -16 -8 -27.5 t26 -11.5h137v-275q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v275h137q21 0 26 11.5t-8 27.5z",
"circle-arrow-down":"M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM675 900h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-275h-137q-21 0 -26 -11.5 t8 -27.5l223 -275q13 -16 32 -16t32 16l223 275q13 16 8 27.5t-26 11.5h-137v275q0 10 -7.5 17.5t-17.5 7.5z",
"globe":"M600 1176q116 0 222.5 -46t184 -123.5t123.5 -184t46 -222.5t-46 -222.5t-123.5 -184t-184 -123.5t-222.5 -46t-222.5 46t-184 123.5t-123.5 184t-46 222.5t46 222.5t123.5 184t184 123.5t222.5 46zM627 1101q-15 -12 -36.5 -20.5t-35.5 -12t-43 -8t-39 -6.5 q-15 -3 -45.5 0t-45.5 -2q-20 -7 -51.5 -26.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79q-9 -34 5 -93t8 -87q0 -9 17 -44.5t16 -59.5q12 0 23 -5t23.5 -15t19.5 -14q16 -8 33 -15t40.5 -15t34.5 -12q21 -9 52.5 -32t60 -38t57.5 -11 q7 -15 -3 -34t-22.5 -40t-9.5 -38q13 -21 23 -34.5t27.5 -27.5t36.5 -18q0 -7 -3.5 -16t-3.5 -14t5 -17q104 -2 221 112q30 29 46.5 47t34.5 49t21 63q-13 8 -37 8.5t-36 7.5q-15 7 -49.5 15t-51.5 19q-18 0 -41 -0.5t-43 -1.5t-42 -6.5t-38 -16.5q-51 -35 -66 -12 q-4 1 -3.5 25.5t0.5 25.5q-6 13 -26.5 17.5t-24.5 6.5q1 15 -0.5 30.5t-7 28t-18.5 11.5t-31 -21q-23 -25 -42 4q-19 28 -8 58q6 16 22 22q6 -1 26 -1.5t33.5 -4t19.5 -13.5q7 -12 18 -24t21.5 -20.5t20 -15t15.5 -10.5l5 -3q2 12 7.5 30.5t8 34.5t-0.5 32q-3 18 3.5 29 t18 22.5t15.5 24.5q6 14 10.5 35t8 31t15.5 22.5t34 22.5q-6 18 10 36q8 0 24 -1.5t24.5 -1.5t20 4.5t20.5 15.5q-10 23 -31 42.5t-37.5 29.5t-49 27t-43.5 23q0 1 2 8t3 11.5t1.5 10.5t-1 9.5t-4.5 4.5q31 -13 58.5 -14.5t38.5 2.5l12 5q5 28 -9.5 46t-36.5 24t-50 15 t-41 20q-18 -4 -37 0zM613 994q0 -17 8 -42t17 -45t9 -23q-8 1 -39.5 5.5t-52.5 10t-37 16.5q3 11 16 29.5t16 25.5q10 -10 19 -10t14 6t13.5 14.5t16.5 12.5z",
"wrench":"M756 1157q164 92 306 -9l-259 -138l145 -232l251 126q6 -89 -34 -156.5t-117 -110.5q-60 -34 -127 -39.5t-126 16.5l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5t15 37.5l600 599q-34 101 5.5 201.5t135.5 154.5z",
"tasks":"M100 1196h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 1096h-200v-100h200v100zM100 796h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 696h-500v-100h500v100zM100 396h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 296h-300v-100h300v100z ",
"filter":"M150 1200h900q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM700 500v-300l-200 -200v500l-350 500h900z",
"fullscreen":"M50 1200h300q21 0 25 -10.5t-10 -24.5l-94 -94l199 -199q7 -8 7 -18t-7 -18l-106 -106q-8 -7 -18 -7t-18 7l-199 199l-94 -94q-14 -14 -24.5 -10t-10.5 25v300q0 21 14.5 35.5t35.5 14.5zM850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-199 -199q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l199 199l-94 94q-14 14 -10 24.5t25 10.5zM364 470l106 -106q7 -8 7 -18t-7 -18l-199 -199l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l199 199 q8 7 18 7t18 -7zM1071 271l94 94q14 14 24.5 10t10.5 -25v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -25 10.5t10 24.5l94 94l-199 199q-7 8 -7 18t7 18l106 106q8 7 18 7t18 -7z",
"dashboard":"M596 1192q121 0 231.5 -47.5t190 -127t127 -190t47.5 -231.5t-47.5 -231.5t-127 -190.5t-190 -127t-231.5 -47t-231.5 47t-190.5 127t-127 190.5t-47 231.5t47 231.5t127 190t190.5 127t231.5 47.5zM596 1010q-112 0 -207.5 -55.5t-151 -151t-55.5 -207.5t55.5 -207.5 t151 -151t207.5 -55.5t207.5 55.5t151 151t55.5 207.5t-55.5 207.5t-151 151t-207.5 55.5zM454.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38.5 -16.5t-38.5 16.5t-16 39t16 38.5t38.5 16zM754.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38 -16.5q-14 0 -29 10l-55 -145 q17 -23 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5t-61.5 25.5t-25.5 61.5q0 32 20.5 56.5t51.5 29.5l122 126l1 1q-9 14 -9 28q0 23 16 39t38.5 16zM345.5 709q22.5 0 38.5 -16t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16zM854.5 709q22.5 0 38.5 -16 t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16z",
"paperclip":"M546 173l469 470q91 91 99 192q7 98 -52 175.5t-154 94.5q-22 4 -47 4q-34 0 -66.5 -10t-56.5 -23t-55.5 -38t-48 -41.5t-48.5 -47.5q-376 -375 -391 -390q-30 -27 -45 -41.5t-37.5 -41t-32 -46.5t-16 -47.5t-1.5 -56.5q9 -62 53.5 -95t99.5 -33q74 0 125 51l548 548 q36 36 20 75q-7 16 -21.5 26t-32.5 10q-26 0 -50 -23q-13 -12 -39 -38l-341 -338q-15 -15 -35.5 -15.5t-34.5 13.5t-14 34.5t14 34.5q327 333 361 367q35 35 67.5 51.5t78.5 16.5q14 0 29 -1q44 -8 74.5 -35.5t43.5 -68.5q14 -47 2 -96.5t-47 -84.5q-12 -11 -32 -32 t-79.5 -81t-114.5 -115t-124.5 -123.5t-123 -119.5t-96.5 -89t-57 -45q-56 -27 -120 -27q-70 0 -129 32t-93 89q-48 78 -35 173t81 163l511 511q71 72 111 96q91 55 198 55q80 0 152 -33q78 -36 129.5 -103t66.5 -154q17 -93 -11 -183.5t-94 -156.5l-482 -476 q-15 -15 -36 -16t-37 14t-17.5 34t14.5 35z",
"heart-empty":"M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104zM896 972q-33 0 -64.5 -19t-56.5 -46t-47.5 -53.5t-43.5 -45.5t-37.5 -19t-36 19t-40 45.5t-43 53.5t-54 46t-65.5 19q-67 0 -122.5 -55.5t-55.5 -132.5q0 -23 13.5 -51t46 -65t57.5 -63t76 -75l22 -22q15 -14 44 -44t50.5 -51t46 -44t41 -35t23 -12 t23.5 12t42.5 36t46 44t52.5 52t44 43q4 4 12 13q43 41 63.5 62t52 55t46 55t26 46t11.5 44q0 79 -53 133.5t-120 54.5z",
"pushpin":"M902 1185l283 -282q15 -15 15 -36t-14.5 -35.5t-35.5 -14.5t-35 15l-36 35l-279 -267v-300l-212 210l-308 -307l-280 -203l203 280l307 308l-210 212h300l267 279l-35 36q-15 14 -15 35t14.5 35.5t35.5 14.5t35 -15z",
"sort":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM935 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-900h-200v900h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z",
"sort-by-alphabet":"M1000 700h-100v100h-100v-100h-100v500h300v-500zM400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM801 1100v-200h100v200h-100zM1000 350l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150z ",
"sort-by-alphabet-alt":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 1050l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150zM1000 0h-100v100h-100v-100h-100v500h300v-500zM801 400v-200h100v200h-100z ",
"sort-by-order":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 700h-100v400h-100v100h200v-500zM1100 0h-100v100h-200v400h300v-500zM901 400v-200h100v200h-100z",
"sort-by-order-alt":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1100 700h-100v100h-200v400h300v-500zM901 1100v-200h100v200h-100zM1000 0h-100v400h-100v100h200v-500z",
"sort-by-attributes":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM900 1000h-200v200h200v-200zM1000 700h-300v200h300v-200zM1100 400h-400v200h400v-200zM1200 100h-500v200h500v-200z",
"sort-by-attributes-alt":"M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1200 1000h-500v200h500v-200zM1100 700h-400v200h400v-200zM1000 400h-300v200h300v-200zM900 100h-200v200h200v-200z",
"login":"M550 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h450q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-450q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM338 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z",
"flash":"M793 1182l9 -9q8 -10 5 -27q-3 -11 -79 -225.5t-78 -221.5l300 1q24 0 32.5 -17.5t-5.5 -35.5q-1 0 -133.5 -155t-267 -312.5t-138.5 -162.5q-12 -15 -26 -15h-9l-9 8q-9 11 -4 32q2 9 42 123.5t79 224.5l39 110h-302q-23 0 -31 19q-10 21 6 41q75 86 209.5 237.5 t228 257t98.5 111.5q9 16 25 16h9z",
"log-out":"M350 1100h400q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-450q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h450q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400 q0 165 92.5 257.5t257.5 92.5zM938 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z",
"new window":"M750 1200h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -10.5 -25t-24.5 10l-109 109l-312 -312q-15 -15 -35.5 -15t-35.5 15l-141 141q-15 15 -15 35.5t15 35.5l312 312l-109 109q-14 14 -10 24.5t25 10.5zM456 900h-156q-41 0 -70.5 -29.5t-29.5 -70.5v-500 q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v148l200 200v-298q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5h300z",
"record":"M600 1186q119 0 227.5 -46.5t187 -125t125 -187t46.5 -227.5t-46.5 -227.5t-125 -187t-187 -125t-227.5 -46.5t-227.5 46.5t-187 125t-125 187t-46.5 227.5t46.5 227.5t125 187t187 125t227.5 46.5zM600 1022q-115 0 -212 -56.5t-153.5 -153.5t-56.5 -212t56.5 -212 t153.5 -153.5t212 -56.5t212 56.5t153.5 153.5t56.5 212t-56.5 212t-153.5 153.5t-212 56.5zM600 794q80 0 137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137t57 137t137 57z",
"save":"M450 1200h200q21 0 35.5 -14.5t14.5 -35.5v-350h245q20 0 25 -11t-9 -26l-383 -426q-14 -15 -33.5 -15t-32.5 15l-379 426q-13 15 -8.5 26t25.5 11h250v350q0 21 14.5 35.5t35.5 14.5zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z",
"open":"M583 1182l378 -435q14 -15 9 -31t-26 -16h-244v-250q0 -20 -17 -35t-39 -15h-200q-20 0 -32 14.5t-12 35.5v250h-250q-20 0 -25.5 16.5t8.5 31.5l383 431q14 16 33.5 17t33.5 -14zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z",
"floppy-disk":"M1100 1000v-850q0 -21 -14.5 -35.5t-35.5 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200z",
"floppy-saved":"M1100 1000l-2 -149l-299 -299l-95 95q-9 9 -21.5 9t-21.5 -9l-149 -147h-312v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1132 638l106 -106q7 -7 7 -17.5t-7 -17.5l-420 -421q-8 -7 -18 -7 t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l297 297q7 7 17.5 7t17.5 -7z",
"floppy-remove":"M1100 1000v-269l-103 -103l-134 134q-15 15 -33.5 16.5t-34.5 -12.5l-266 -266h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1202 572l70 -70q15 -15 15 -35.5t-15 -35.5l-131 -131 l131 -131q15 -15 15 -35.5t-15 -35.5l-70 -70q-15 -15 -35.5 -15t-35.5 15l-131 131l-131 -131q-15 -15 -35.5 -15t-35.5 15l-70 70q-15 15 -15 35.5t15 35.5l131 131l-131 131q-15 15 -15 35.5t15 35.5l70 70q15 15 35.5 15t35.5 -15l131 -131l131 131q15 15 35.5 15 t35.5 -15z",
"floppy-save":"M1100 1000v-300h-350q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM850 600h100q21 0 35.5 -14.5t14.5 -35.5v-250h150q21 0 25 -10.5t-10 -24.5 l-230 -230q-14 -14 -35 -14t-35 14l-230 230q-14 14 -10 24.5t25 10.5h150v250q0 21 14.5 35.5t35.5 14.5z",
"floppy-open":"M1100 1000v-400l-165 165q-14 15 -35 15t-35 -15l-263 -265h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM935 565l230 -229q14 -15 10 -25.5t-25 -10.5h-150v-250q0 -20 -14.5 -35 t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35v250h-150q-21 0 -25 10.5t10 25.5l230 229q14 15 35 15t35 -15z",
"credit-card":"M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-150h-1200v150q0 21 14.5 35.5t35.5 14.5zM1200 800v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v550h1200zM100 500v-200h400v200h-400z",
"transfer":"M935 1165l248 -230q14 -14 14 -35t-14 -35l-248 -230q-14 -14 -24.5 -10t-10.5 25v150h-400v200h400v150q0 21 10.5 25t24.5 -10zM200 800h-50q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v-200zM400 800h-100v200h100v-200zM18 435l247 230 q14 14 24.5 10t10.5 -25v-150h400v-200h-400v-150q0 -21 -10.5 -25t-24.5 10l-247 230q-15 14 -15 35t15 35zM900 300h-100v200h100v-200zM1000 500h51q20 0 34.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-34.5 -14.5h-51v200z",
"sd-video":"M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z",
"cloud-download":"M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -207t-85 -207t-205 -86.5h-128v250q0 21 -14.5 35.5t-35.5 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-250h-222q-80 0 -136 57.5t-56 136.5q0 69 43 122.5t108 67.5q-2 19 -2 37q0 100 49 185 t134 134t185 49zM525 500h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -244q-13 -16 -32 -16t-32 16l-223 244q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z",
"cloud-upload":"M502 1089q110 0 201 -59.5t135 -156.5q43 15 89 15q121 0 206 -86.5t86 -206.5q0 -99 -60 -181t-150 -110l-378 360q-13 16 -31.5 16t-31.5 -16l-381 -365h-9q-79 0 -135.5 57.5t-56.5 136.5q0 69 43 122.5t108 67.5q-2 19 -2 38q0 100 49 184.5t133.5 134t184.5 49.5z M632 467l223 -228q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5q199 204 223 228q19 19 31.5 19t32.5 -19z",
"cd":"M1010 1010q111 -111 150.5 -260.5t0 -299t-150.5 -260.5q-83 -83 -191.5 -126.5t-218.5 -43.5t-218.5 43.5t-191.5 126.5q-111 111 -150.5 260.5t0 299t150.5 260.5q83 83 191.5 126.5t218.5 43.5t218.5 -43.5t191.5 -126.5zM476 1065q-4 0 -8 -1q-121 -34 -209.5 -122.5 t-122.5 -209.5q-4 -12 2.5 -23t18.5 -14l36 -9q3 -1 7 -1q23 0 29 22q27 96 98 166q70 71 166 98q11 3 17.5 13.5t3.5 22.5l-9 35q-3 13 -14 19q-7 4 -15 4zM512 920q-4 0 -9 -2q-80 -24 -138.5 -82.5t-82.5 -138.5q-4 -13 2 -24t19 -14l34 -9q4 -1 8 -1q22 0 28 21 q18 58 58.5 98.5t97.5 58.5q12 3 18 13.5t3 21.5l-9 35q-3 12 -14 19q-7 4 -15 4zM719.5 719.5q-49.5 49.5 -119.5 49.5t-119.5 -49.5t-49.5 -119.5t49.5 -119.5t119.5 -49.5t119.5 49.5t49.5 119.5t-49.5 119.5zM855 551q-22 0 -28 -21q-18 -58 -58.5 -98.5t-98.5 -57.5 q-11 -4 -17 -14.5t-3 -21.5l9 -35q3 -12 14 -19q7 -4 15 -4q4 0 9 2q80 24 138.5 82.5t82.5 138.5q4 13 -2.5 24t-18.5 14l-34 9q-4 1 -8 1zM1000 515q-23 0 -29 -22q-27 -96 -98 -166q-70 -71 -166 -98q-11 -3 -17.5 -13.5t-3.5 -22.5l9 -35q3 -13 14 -19q7 -4 15 -4 q4 0 8 1q121 34 209.5 122.5t122.5 209.5q4 12 -2.5 23t-18.5 14l-36 9q-3 1 -7 1z",
"save-file":"M700 800h300v-380h-180v200h-340v-200h-380v755q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM700 300h162l-212 -212l-212 212h162v200h100v-200zM520 0h-395q-10 0 -17.5 7.5t-7.5 17.5v395zM1000 220v-195q0 -10 -7.5 -17.5t-17.5 -7.5h-195z",
"open-file":"M700 800h300v-520l-350 350l-550 -550v1095q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM862 200h-162v-200h-100v200h-162l212 212zM480 0h-355q-10 0 -17.5 7.5t-7.5 17.5v55h380v-80zM1000 80v-55q0 -10 -7.5 -17.5t-17.5 -7.5h-155v80h180z",
"level-up":"M1162 800h-162v-200h100l100 -100h-300v300h-162l212 212zM200 800h200q27 0 40 -2t29.5 -10.5t23.5 -30t7 -57.5h300v-100h-600l-200 -350v450h100q0 36 7 57.5t23.5 30t29.5 10.5t40 2zM800 400h240l-240 -400h-800l300 500h500v-100z",
"copy":"M650 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM1000 850v150q41 0 70.5 -29.5t29.5 -70.5v-800 q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-1 0 -20 4l246 246l-326 326v324q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM412 250l-212 -212v162h-200v100h200v162z",
"paste":"M450 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM800 850v150q41 0 70.5 -29.5t29.5 -70.5v-500 h-200v-300h200q0 -36 -7 -57.5t-23.5 -30t-29.5 -10.5t-40 -2h-600q-41 0 -70.5 29.5t-29.5 70.5v800q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM1212 250l-212 -212v162h-200v100h200v162z",
"alert":"M658 1197l637 -1104q23 -38 7 -65.5t-60 -27.5h-1276q-44 0 -60 27.5t7 65.5l637 1104q22 39 54 39t54 -39zM704 800h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM500 300v-100h200 v100h-200z",
"duplicate":"M900 800h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-375v591l-300 300v84q0 10 7.5 17.5t17.5 7.5h375v-400zM1200 900h-200v200zM400 600h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-650q-10 0 -17.5 7.5t-7.5 17.5v950q0 10 7.5 17.5t17.5 7.5h375v-400zM700 700h-200v200z ",
"scissors":"M641 900l423 247q19 8 42 2.5t37 -21.5l32 -38q14 -15 12.5 -36t-17.5 -34l-139 -120h-390zM50 1100h106q67 0 103 -17t66 -71l102 -212h823q21 0 35.5 -14.5t14.5 -35.5v-50q0 -21 -14 -40t-33 -26l-737 -132q-23 -4 -40 6t-26 25q-42 67 -100 67h-300q-62 0 -106 44 t-44 106v200q0 62 44 106t106 44zM173 928h-80q-19 0 -28 -14t-9 -35v-56q0 -51 42 -51h134q16 0 21.5 8t5.5 24q0 11 -16 45t-27 51q-18 28 -43 28zM550 727q-32 0 -54.5 -22.5t-22.5 -54.5t22.5 -54.5t54.5 -22.5t54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5zM130 389 l152 130q18 19 34 24t31 -3.5t24.5 -17.5t25.5 -28q28 -35 50.5 -51t48.5 -13l63 5l48 -179q13 -61 -3.5 -97.5t-67.5 -79.5l-80 -69q-47 -40 -109 -35.5t-103 51.5l-130 151q-40 47 -35.5 109.5t51.5 102.5zM380 377l-102 -88q-31 -27 2 -65l37 -43q13 -15 27.5 -19.5 t31.5 6.5l61 53q19 16 14 49q-2 20 -12 56t-17 45q-11 12 -19 14t-23 -8z",
"scale":"M212 1198h780q86 0 147 -61t61 -147v-416q0 -51 -18 -142.5t-36 -157.5l-18 -66q-29 -87 -93.5 -146.5t-146.5 -59.5h-572q-82 0 -147 59t-93 147q-8 28 -20 73t-32 143.5t-20 149.5v416q0 86 61 147t147 61zM600 1045q-70 0 -132.5 -11.5t-105.5 -30.5t-78.5 -41.5 t-57 -45t-36 -41t-20.5 -30.5l-6 -12l156 -243h560l156 243q-2 5 -6 12.5t-20 29.5t-36.5 42t-57 44.5t-79 42t-105 29.5t-132.5 12zM762 703h-157l195 261z",
"ice-lolly":"M475 1300h150q103 0 189 -86t86 -189v-500q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z",
"triangle-right":"M865 565l-494 -494q-23 -23 -41 -23q-14 0 -22 13.5t-8 38.5v1000q0 25 8 38.5t22 13.5q18 0 41 -23l494 -494q14 -14 14 -35t-14 -35z",
"triangle-left":"M335 635l494 494q29 29 50 20.5t21 -49.5v-1000q0 -41 -21 -49.5t-50 20.5l-494 494q-14 14 -14 35t14 35z",
"triangle-bottom":"M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z",
"triangle-top":"M635 865l494 -494q29 -29 20.5 -50t-49.5 -21h-1000q-41 0 -49.5 21t20.5 50l494 494q14 14 35 14t35 -14z",
"plus":"M450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-350h350q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-350v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v350h-350q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5 h350v350q0 21 14.5 35.5t35.5 14.5z",
};
function get_icon_svg(name, w, h){
var content = "";
if (typeof w == 'undefined') w = "1.3em";
if (typeof h == 'undefined') h = "1.2em";
var has_error = false;
try{
content = list_icon[name];
}
catch (e) {
console.error("Parsing error:", e);
has_error = true;
}
if (has_error) return "";
var icon = "<svg width='" + w + "' height='" + h + "' viewBox='0 0 1300 1200'><g transform='translate(30,1200) scale(1, -1)'><path fill='currentColor' d='";
icon+= content;
icon+= "' /></g></svg>";
return icon;
}

22
www/js/inputdlg.js Normal file
View File

@@ -0,0 +1,22 @@
//input dialog
function inputdlg(titledlg, textdlg, closefunc, preset) {
var modal = setactiveModal('inputdlg.html',closefunc);
if ( modal == null) return;
var title = modal.element.getElementsByClassName("modal-title")[0];
var body = modal.element.getElementsByClassName("modal-text")[0];
title.innerHTML=titledlg;
body.innerHTML=textdlg;
if (typeof preset !== 'undefined') document.getElementById('inputldg_text').value=preset;
else document.getElementById('inputldg_text').value = "";
showModal() ;
}
function closeInputModal(response) {
var answer = "";
if (response == "ok") {
var input = document.getElementById('inputldg_text').value;
answer = input.trim();
}
closeModal(answer);
}

18
www/js/localstorage.js Normal file
View File

@@ -0,0 +1,18 @@
function store_localdata(key, value){
if (typeof localStorage !== 'undefined'){
localStorage.setItem(key, value);
return true;
}
return false;
}
function get_localdata(key){
if (typeof localStorage !== 'undefined'){
return localStorage.getItem(key);
}
return "";
}
function delete_localdata(key){
if (typeof localStorage !== 'undefined')window.localStorage.removeItem(key);
}

292
www/js/macrodlg.js Normal file
View File

@@ -0,0 +1,292 @@
//Macro dialog
var macrodlg_macrolist = [];
function showmacrodlg(closefn) {
var modal = setactiveModal('macrodlg.html',closefn);
if ( modal == null) return;
build_dlg_macrolist_ui();
document.getElementById('macrodlg_upload_msg').style.display='none';
showModal() ;
}
function build_color_selection(index){
var content = "";
var entry = macrodlg_macrolist[index];
var menu_pos = "down";
if (index > 3 ) menu_pos = "up";
content +="<div class='dropdownselect' id='macro_color_line"+index+"'>";
content +="<button class='btn " + entry.class + "' onclick='showhide_drop_menu(event)'>&nbsp;";
content +="<svg width='0.8em' height='0.8em' viewBox='0 0 1300 1200' style='pointer-events:none'>";
content +="<g transform='translate(50,1200) scale(1, -1)'>";
content +="<path fill='currentColor' d='M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z' />";
content +="</g>";
content +="</svg>";
content +="</button>";
content +="<div class='dropmenu-content dropmenu-content-" + menu_pos+ "' style='min-width:auto; padding-left: 4px;padding-right: 4px;'>";
content +="<button class='btn btn-default' onclick='macro_select_color(event, \"default\" ," + index + ")'>&nbsp;</button>";
content +="<button class='btn btn-primary' onclick='macro_select_color(event, \"primary\" ," + index + ")'>&nbsp;</button>";
content +="<button class='btn btn-info' onclick='macro_select_color(event, \"info\" ," + index + ")'>&nbsp;</button>";
content +="<button class='btn btn-warning' onclick='macro_select_color(event, \"warning\" ," + index + ")'>&nbsp;</button>";
content +="<button class='btn btn-danger' onclick='macro_select_color(event, \"danger\" ," + index + ")'>&nbsp;</button>";
content +="</div>";
content +="</div>";
return content;
}
function build_target_selection(index){
var content = "";
var entry = macrodlg_macrolist[index];
var menu_pos = "down";
if (index > 3 ) menu_pos = "up";
content +="<div class='dropdownselect' id='macro_target_line"+index+"'>";
content +="<button class='btn btn-default' style='min-width:5em;' onclick='showhide_drop_menu(event)'><span>" + entry.target + "</span>";
content +="<svg width='0.8em' height='0.8em' viewBox='0 0 1300 1200' style='pointer-events:none'>";
content +="<g transform='translate(50,1200) scale(1, -1)'>";
content +="<path fill='currentColor' d='M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z' />";
content +="</g>";
content +="</svg>";
content +="</button>";
content +="<div class='dropmenu-content dropmenu-content-" + menu_pos+ "' style='min-width:auto'>";
content +="<a href=# onclick='macro_select_target(event, \"ESP\" ," + index + ")'>ESP</a>";
content +="<a href=# onclick='macro_select_target(event, \"SD\" ," + index + ")'>SD</a>";
content +="</div>";
content +="</div>";
return content;
}
function build_glyph_selection(index){
var content = "";
var entry = macrodlg_macrolist[index];
var menu_pos = "down";
if (index > 3 ) menu_pos = "up";
content +="<div class='dropdownselect' id='macro_glyph_line"+index+"'>";
content +="<button class='btn "+ entry.class +"' onclick='showhide_drop_menu(event)'><span>" + get_icon_svg(entry.glyph) + "</span>&nbsp;";
content +="<svg width='0.8em' height='0.8em' viewBox='0 0 1300 1200' style='pointer-events:none'>";
content +="<g transform='translate(50,1200) scale(1, -1)'>";
content +="<path fill='currentColor' d='M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z' />";
content +="</g>";
content +="</svg>";
content +="</button>";
content +="<div class='dropmenu-content dropmenu-content-" + menu_pos+ "' style='min-width:30em'>";
for (var key in list_icon){
if (key !="plus"){
content +="<button class='btn btn-default btn-xs' onclick='macro_select_glyph(event, \"" +key + "\" ," + index + ")'><span>" + get_icon_svg(key) + "</span>";
content +="</button>";
}
}
content +="</div>";
content +="</div>";
return content;
}
function build_filename_selection(index){
var content = "";
var entry = macrodlg_macrolist[index];
content +="<span id='macro_filename_input_line_"+index+"' class='form-group "
if(entry.filename.length == 0) content +="has-error has-feedback"
content +="'>";
content +="<input type='text' id='macro_filename_line_"+index+"' style='width:9em' class='form-control' onkeyup='macro_filename_OnKeyUp(this," + index + ")' onchange='on_macro_filename(this," + index + ")' value='"+entry.filename+"' aria-describedby='inputStatus_line" + index + "'>";
content +="<span id='icon_macro_status_line_" + index + "' style='color:#a94442; position:absolute;bottom:4px;left:7.5em;";
if(entry.filename.length > 0) content +="display:none";
content +="'>" + get_icon_svg("remove") + "</span>";
content +="</input></span>";
return content;
}
function build_dlg_macrolist_line(index){
var content ="";
var entry = macrodlg_macrolist[index];
content +="<td style='vertical-align:middle'>";
content +="<button onclick='macro_reset_button("+index+")' class='btn btn-xs ";
if (entry.class == ''){
content +="btn-default' style='padding-top: 3px;padding-left: 4px;padding-right: 2px;padding-bottom: 0px;' >"+get_icon_svg("plus")+" </button></td><td colspan='5'>";
}
else {
content +="btn-danger' style='padding-top: 3px;padding-left: 2px;padding-right: 3px;padding-bottom: 0px;' >" + get_icon_svg("trash") +"</button></td>";
content +="<td style='vertical-align:middle'><input type='text' id='macro_name_line_"+index+"' style='width:4em' class='form-control' onchange='on_macro_name(this," + index + ")' value='";
if (entry.name != "&nbsp;"){
content +=entry.name;
}
content +="'/></td>";
content +="<td style='vertical-align:middle'>"+build_glyph_selection(index)+"</td>";
content +="<td style='vertical-align:middle'>"+build_color_selection(index)+"</td>";
content +="<td style='vertical-align:middle'>" + build_target_selection(index) + "</td>";
content +="<td style='vertical-align:middle'>" + build_filename_selection(index) + "</td>";
}
content +="</td>";
document.getElementById('macro_line_' + index).innerHTML = content;
}
function macro_filename_OnKeyUp(event, index){
var item = document.getElementById("macro_filename_line_"+index);
var group = document.getElementById("macro_filename_input_line_"+index);
var value = item.value.trim();
if (value.length > 0 ){
if (group.classList.contains('has-feedback'))group.classList.remove('has-feedback');
if (group.classList.contains('has-error'))group.classList.remove('has-error');
document.getElementById("icon_macro_status_line_"+index).style.display='none';
} else
{
document.getElementById("icon_macro_status_line_"+index).style.display='block';
if (!group.classList.contains('has-error'))group.classList.add('has-error');
if (!group.classList.contains('has-feedback'))group.classList.add('has-feedback');
}
return true;
}
function on_macro_filename(item, index){
var entry = macrodlg_macrolist[index];
var filename = item.value.trim();
entry.filename = item.value;
if (filename.length == 0)
{
alertdlg (translate_text_item("Out of range"), translate_text_item( "File name cannot be empty!"));
}
build_dlg_macrolist_line(index);
}
function on_macro_name(item, index){
var entry = macrodlg_macrolist[index];
var macroname = item.value.trim();
if (macroname.length > 0)
{
entry.name = item.value;
}
else {
entry.name ="&nbsp;";
}
}
function build_dlg_macrolist_ui(){
var content = "";
macrodlg_macrolist = [];
for (var i = 0; i < 9; i++){
var entry = {name : control_macrolist[i].name, glyph: control_macrolist[i].glyph, filename : control_macrolist[i].filename, target : control_macrolist[i].target, class : control_macrolist[i].class, index: control_macrolist[i].index};
macrodlg_macrolist.push(entry);
content +="<tr style='vertical-align:middle' id='macro_line_"+i+"'>";
content +="</tr>";
}
document.getElementById('dlg_macro_list').innerHTML = content;
for (var i = 0; i < 9; i++)build_dlg_macrolist_line(i);
}
function macro_reset_button(index){
var entry = macrodlg_macrolist[index];
if (entry.class == "") {
entry.name = "M"+(1+entry.index);
entry.glyph = "star";
entry.filename = "/macro"+(1+entry.index)+".g";
entry.target = "ESP";
entry.class = "btn-default";
}
else {
entry.name = "";
entry.glyph = "";
entry.filename = "";
entry.target = "";
entry.class = "";
}
build_dlg_macrolist_line(index);
}
function macro_select_color(event, color ,index){
var entry = macrodlg_macrolist[index];
hide_drop_menu(event);
entry.class="btn btn-"+color;
build_dlg_macrolist_line(index);
}
function macro_select_target(event, target ,index){
var entry = macrodlg_macrolist[index];
hide_drop_menu(event);
entry.target=target;
build_dlg_macrolist_line(index)
}
function macro_select_glyph(event, glyph ,index){
var entry = macrodlg_macrolist[index];
hide_drop_menu(event);
entry.glyph=glyph;
build_dlg_macrolist_line(index)
}
function closeMacroDialog(){
var modified = false;
for (var i = 0; i < 9; i++){
if ((macrodlg_macrolist[i].filename!==control_macrolist[i].filename) || (macrodlg_macrolist[i].name!==control_macrolist[i].name) || (macrodlg_macrolist[i].glyph!==control_macrolist[i].glyph) || (macrodlg_macrolist[i].class!==control_macrolist[i].class) || (macrodlg_macrolist[i].target!==control_macrolist[i].target)){
modified = true;
}
}
if (modified){
confirmdlg(translate_text_item("Data mofified"), translate_text_item("Do you want to save?"), process_macroCloseDialog)
}
else closeModal('cancel');
}
function process_macroCloseDialog(answer){
if (answer == 'no' ){
//console.log("Answer is no so exit");
closeModal('cancel');
}
else {
// console.log("Answer is yes so let's save");
SaveNewMacroList();
}
}
function SaveNewMacroList(){
if (http_communication_locked) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Communications are currently locked, please wait and retry."));
return;
}
for (var i = 0; i < 9; i++){
if (macrodlg_macrolist[i].filename.length == 0 && macrodlg_macrolist[i].class!=""){
alertdlg (translate_text_item("Out of range"), translate_text_item( "File name cannot be empty!"));
return;
}
}
var blob = new Blob([JSON.stringify(macrodlg_macrolist, null, " ")], {type : 'application/json'});
var file = new File([blob], '/macrocfg.json');
var formData = new FormData();
var url = "/files";
formData.append('path', '/');
formData.append('myfile[]', file, '/macrocfg.json');
SendFileHttp(url, formData, macrodlgUploadProgressDisplay, macroUploadsuccess, macroUploadfailed)
}
function macrodlgUploadProgressDisplay(oEvent){
if (oEvent.lengthComputable) {
var percentComplete = (oEvent.loaded / oEvent.total)*100;
document.getElementById('macrodlg_prg').value=percentComplete;
document.getElementById('macrodlg_upload_percent').innerHTML = percentComplete.toFixed(0) ;
document.getElementById('macrodlg_upload_msg').style.display='block';
} else {
// Impossible because size is unknown
}
}
function macroUploadsuccess(response){
control_macrolist = [];
for (var i = 0; i < 9 ; i++) {
var entry;
if ((macrodlg_macrolist.length != 0)) {
entry = {name : macrodlg_macrolist[i].name, glyph: macrodlg_macrolist[i].glyph, filename : macrodlg_macrolist[i].filename, target : macrodlg_macrolist[i].target, class : macrodlg_macrolist[i].class, index: macrodlg_macrolist[i].index};
}
else {
entry = {name :'', glyph: '', filename : '', target : '', class : '', index: i};
}
control_macrolist.push(entry);
}
document.getElementById('macrodlg_upload_msg').style.display='none';
closeModal('ok');
}
function macroUploadfailed(errorcode, response){
alertdlg (translate_text_item("Error"), translate_text_item("Save macro list failed!"));
document.getElementById('macrodlg_upload_msg').style.display='none';
}

55
www/js/modaldlg.js Normal file
View File

@@ -0,0 +1,55 @@
// Create the modal
var listmodal =[];
function setactiveModal(html_template, closefunc){
if (typeof document.getElementById(html_template) === 'undefined')
{
console.log("Error: no " + html_template);
return null;
}
var modal = new Object;
modal.element=document.getElementById(html_template);
modal.id = listmodal.length;
modal.name=html_template;
if (typeof closefunc !== 'undefined') modal.closefn = closefunc;
else modal.closefn = myfnclose;
listmodal.push(modal)
//console.log("Creation of modal " + modal.name + " with ID " +modal.id);
return listmodal[listmodal.length-1];;
}
function getactiveModal(){
if (listmodal.length>0)
{
return listmodal[listmodal.length-1];
}
else return null;
}
// open the modal
function showModal() {
var currentmodal = getactiveModal();
currentmodal.element.style.display = "block";
//console.log("Show modal " + currentmodal.name + " with ID " + currentmodal.id );
}
// When the user clicks on <span> (x), close the modal
function closeModal( response) {
var currentmodal = getactiveModal();
if (currentmodal != null) {
currentmodal.element.style.display = "none";
var closefn = currentmodal.closefn;
//console.log("Deletetion of modal " + currentmodal.name + " with ID " + currentmodal.id);
listmodal.pop();
delete currentmodal;
currentmodal = getactiveModal();
//if (currentmodal != null)console.log("New active modal is " + currentmodal.name + " with ID " + currentmodal.id);
//else console.log("No active modal");
closefn(response);
}
}
//default close function
function myfnclose(value) {
//console.log("modale closed: " + value);
}

49
www/js/printercmd.js Normal file
View File

@@ -0,0 +1,49 @@
function SendPrinterCommand(cmd, echo_on, processfn, errorfn){
var url = "/command?commandText=";
var push_cmd = true;
if (typeof echo_on !== 'undefined') {
push_cmd = echo_on;
}
if (cmd.trim().length == 0) return;
if (push_cmd)Monitor_output_Update(cmd + "\n");
//removeIf(production)
console.log(cmd);
if (typeof processfn !== 'undefined')processfn("Test response");
else SendPrinterCommandSuccess("Test response");
return;
//endRemoveIf(production)
if (typeof processfn === 'undefined' || processfn == null) processfn = SendPrinterCommandSuccess;
if (typeof errorfn === 'undefined' || errorfn ==null) errorfn = SendPrinterCommandFailed;
SendGetHttp(url + encodeURI(cmd), processfn, errorfn);
//console.log(cmd);
}
function SendPrinterSilentCommand(cmd, processfn, errorfn){
var url = "/command_silent?commandText=";
if (cmd.trim().length == 0) return;
//removeIf(production)
console.log(cmd);
if (typeof processfn !== 'undefined')processfn("Test response");
else SendPrinterCommandSuccess("Test response");
return;
//endRemoveIf(production)
if (typeof processfn === 'undefined' || processfn == null) processfn = SendPrinterSilentCommandSuccess;
if (typeof errorfn === 'undefined' || errorfn == null) errorfn = SendPrinterCommandFailed;
SendGetHttp(url + encodeURI(cmd), processfn, errorfn);
//console.log(cmd);
}
function SendPrinterSilentCommandSuccess(response){
//console.log(response);
}
function SendPrinterCommandSuccess(response){
if (response[response.length-1] != '\n')Monitor_output_Update(response + "\n");
else Monitor_output_Update(response);
}
function SendPrinterCommandFailed(error_code,response){
Monitor_output_Update("Error " + error_code + " :" + response+ "\n");
console.log("Error " + error_code + " :" + response);
}

39
www/js/restartdlg.js Normal file
View File

@@ -0,0 +1,39 @@
//restart dialog
function restartdlg () {
console.log("show restart");
var modal = setactiveModal('restartdlg.html');
if ( modal == null) return;
document.getElementById('prgrestart').style.display = 'block';
document.getElementById('restartmsg').innerHTML = translate_text_item("Restarting, please wait....");
showModal();
SendPrinterCommand("[ESP444]RESTART", false, restart_esp_success, restart_esp_failed);
}
function restart_esp_success(response){
var i = 0;
var interval;
var x = document.getElementById("prgrestart");
http_communication_locked = true;
x.max=40;
interval = setInterval(function(){
i=i+1;
var x = document.getElementById("prgrestart");
x.value=i;
document.getElementById('restartmsg').innerHTML = translate_text_item("Restarting, please wait....") + (41-i) +translate_text_item(" seconds") ;
if (i>40)
{
clearInterval(interval);
location.reload();
}
},1000);
//console.log(response);
}
function restart_esp_failed(errorcode, response){
document.getElementById('prgrestart').style.display = 'none';
document.getElementById('restartmsg').innerHTML = translate_text_item("Upload failed : ") + errorcode + " :" + response;
console.log("Error " + errorcode + " : " + response);
closeModal('Cancel')
}

96
www/js/scanwifidlg.js Normal file
View File

@@ -0,0 +1,96 @@
var ssid_item_scanwifi = -1;
//scanwifi dialog
function scanwifidlg (item) {
var modal = setactiveModal('scanwifidlg.html',scanwifidlg_close);
if ( modal == null) return;
ssid_item_scanwifi = item;
showModal() ;
refresh_scanwifi();
}
function refresh_scanwifi(){
document.getElementById('AP_scan_loader').style.display='block';
document.getElementById('AP_scan_list').style.display='none';
document.getElementById('AP_scan_status').style.display='block';
document.getElementById('AP_scan_status').innerHTML = translate_text_item("Scanning");
document.getElementById('refresh_scanwifi_btn').style.display='none';
//removeIf(production)
var response_text = "{\"AP_LIST\":[{\"SSID\":\"HP-Setup>71-M277LaserJet\",\"SIGNAL\":\"90\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"NETGEAR_2GEXT_OFFICE2\",\"SIGNAL\":\"58\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"NETGEAR_2GEXT_OFFICE\",\"SIGNAL\":\"34\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"NETGEAR_2GEXT_COULOIR\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"HP-Print-D3-ColorLaserJetPro\",\"SIGNAL\":\"14\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"external-wifi\",\"SIGNAL\":\"20\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"Livebox-4D0F\",\"SIGNAL\":\"24\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFR_2000\",\"SIGNAL\":\"20\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFR_0D90\",\"SIGNAL\":\"26\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"SFRWiFiFON\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"0\"},{\"SSID\":\"SFRWiFiMobile\",\"SIGNAL\":\"18\",\"IS_PROTECTED\":\"1\"},{\"SSID\":\"FreeWifi\",\"SIGNAL\":\"16\",\"IS_PROTECTED\":\"0\"}]}";
getscanWifiSuccess(response_text);
return;
//endRemoveIf(production)
var url = "/command?plain="+encodeURIComponent("[ESP410]");
SendGetHttp(url, getscanWifiSuccess, getscanWififailed);
}
function process_scanWifi_answer(response_text){
var result= true;
var content = "";
try {
var response = JSON.parse(response_text);
if(typeof response.AP_LIST == 'undefined') {
result = false;
}
else {
var aplist = response.AP_LIST;
//console.log("found " + aplist.length + " AP");
aplist.sort(function(a, b) {
return (parseInt(a.SIGNAL) < parseInt(b.SIGNAL)) ? -1 : (parseInt(a.SIGNAL) > parseInt(b.SIGNAL)) ? 1 : 0
});
for (var i = aplist.length-1; i >=0; i--){
content+="<tr>";
content+="<td style='vertical-align:middle'>";
content+=aplist[i].SSID;
content+="</td>";
content+="<td style='text-align: center;vertical-align:middle;'>";
content+=aplist[i].SIGNAL;
content+="%</td>";
content+="<td style='vertical-align:middle'><center>";
if (aplist[i].IS_PROTECTED == "1")content += get_icon_svg("lock");
content+="</></td>";
content+="<td>";
content+="<button class='btn btn-primary' onclick='select_ap_ssid(\""+aplist[i].SSID+"\");'>";
content+=get_icon_svg("ok");
content+="</button>";
content+="</td>";
content+="</tr>";
}
}
}
catch (e) {
console.error("Parsing error:", e);
result= false;
}
document.getElementById('AP_scan_data').innerHTML = content;
return result;
}
function select_ap_ssid(ssid_name){
document.getElementById("setting_" + ssid_item_scanwifi).value=ssid_name;
document.getElementById("setting_"+ ssid_item_scanwifi).focus();
setsettingchanged(ssid_item_scanwifi);
closeModal("Ok") ;
}
function getscanWifiSuccess(response){
if (!process_scanWifi_answer(response)){
getscanWififailed(406, translate_text_item("Wrong data"));
return;
}
document.getElementById('AP_scan_loader').style.display="none";
document.getElementById('AP_scan_list').style.display="block";
document.getElementById('AP_scan_status').style.display="none";
document.getElementById('refresh_scanwifi_btn').style.display="block";
}
function getscanWififailed(error_code, response){
console.log("Error " + error_code + " :" + response);
document.getElementById('AP_scan_loader').style.display="none";
document.getElementById('AP_scan_status').style.display="block";
document.getElementById('AP_scan_status').innerHTML=translate_text_item( "Failed:") + error_code + " " + response;
document.getElementById('refresh_scanwifi_btn').style.display="block";
}
function scanwifidlg_close (response) {
//console.log(response);
}

350
www/js/settings.js Normal file
View File

@@ -0,0 +1,350 @@
var setting_configList = [];
var setting_error_msg="";
var setting_lastindex = -1;
var current_setting_filter = 'network';
function refreshSettings() {
if (http_communication_locked) {
document.getElementById('config_status').innerHTML=translate_text_item("Communication locked by another process, retry later.");
return;
}
document.getElementById('settings_loader').style.display="block";
document.getElementById('settings_list_content').style.display="none";
document.getElementById('settings_status').style.display="none";
document.getElementById('settings_refresh_btn').style.display="none";
setting_configList = [];
//removeIf(production)
var response_text = "{\"EEPROM\":[{\"F\":\"network\",\"P\":\"0\",\"T\":\"B\",\"V\":\"2\",\"H\":\"Wifi mode\",\"O\":[{\"AP\":\"1\"},{\"STA\":\"2\"}]},{\"F\":\"network\",\"P\":\"1\",\"T\":\"S\",\"V\":\"totolink_luc\",\"S\":\"32\",\"H\":\"Station SSID\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"34\",\"T\":\"S\",\"V\":\"********\",\"S\":\"64\",\"H\":\"Station Password\",\"M\":\"0\"},{\"F\":\"network\",\"P\":\"99\",\"T\":\"B\",\"V\":\"1\",\"H\":\"Station IP Mode\",\"O\":[{\"DHCP\":\"1\"},{\"Static\":\"2\"}]},{\"F\":\"network\",\"P\":\"100\",\"T\":\"A\",\"V\":\"192.168.0.1\",\"H\":\"Station Static IP\"},{\"F\":\"network\",\"P\":\"104\",\"T\":\"A\",\"V\":\"255.255.255.0\",\"H\":\"Station Static Mask\"},{\"F\":\"network\",\"P\":\"108\",\"T\":\"A\",\"V\":\"192.168.0.12\",\"H\":\"Station Static Gateway\"},{\"F\":\"network\",\"P\":\"130\",\"T\":\"S\",\"V\":\"lucesp\",\"H\":\"Hostname\" ,\"S\":\"32\", \"M\":\"1\"},{\"F\":\"network\",\"P\":\"112\",\"T\":\"I\",\"V\":\"115200\",\"H\":\"Baud Rate\",\"O\":[{\"9600\":\"9600\"},{\"19200\":\"19200\"},{\"38400\":\"38400\"},{\"57600\":\"57600\"},{\"115200\":\"115200\"},{\"230400\":\"230400\"},{\"250000\":\"250000\"}]},{\"F\":\"network\",\"P\":\"116\",\"T\":\"B\",\"V\":\"2\",\"H\":\"Station Network Mode\",\"O\":[{\"11b\":\"1\"},{\"11g\":\"2\"},{\"11n\":\"3\"}]},{\"F\":\"network\",\"P\":\"117\",\"T\":\"B\",\"V\":\"0\",\"H\":\"Sleep Mode\",\"O\":[{\"None\":\"0\"},{\"Light\":\"1\"},{\"Modem\":\"2\"}]},{\"F\":\"network\",\"P\":\"118\",\"T\":\"B\",\"V\":\"9\",\"H\":\"AP Channel\",\"O\":[{\"1\":\"1\"},{\"2\":\"2\"},{\"3\":\"3\"},{\"4\":\"4\"},{\"5\":\"5\"},{\"6\":\"6\"},{\"7\":\"7\"},{\"8\":\"8\"},{\"9\":\"9\"},{\"10\":\"10\"},{\"11\":\"11\"}]},{\"F\":\"network\",\"P\":\"119\",\"T\":\"B\",\"V\":\"2\",\"H\":\"Authentication\",\"O\":[{\"Open\":\"0\"},{\"WPA\":\"2\"},{\"WPA2\":\"3\"},{\"WPA/WPA2\":\"4\"}]},{\"F\":\"network\",\"P\":\"120\",\"T\":\"B\",\"V\":\"1\",\"H\":\"SSID Visible\",\"O\":[{\"No\":\"0\"},{\"Yes\":\"1\"}]},{\"F\":\"network\",\"P\":\"121\",\"T\":\"I\",\"V\":\"80\",\"H\":\"Web Port\",\"S\":\"65001\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"125\",\"T\":\"I\",\"V\":\"8881\",\"H\":\"Data Port\",\"S\":\"65001\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"176\",\"T\":\"S\",\"V\":\"********\",\"S\":\"16\",\"H\":\"Admin Password\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"197\",\"T\":\"S\",\"V\":\"********\",\"S\":\"16\",\"H\":\"User Password\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"218\",\"T\":\"S\",\"V\":\"MYESP\",\"S\":\"32\",\"H\":\"AP SSID\",\"M\":\"1\"},{\"F\":\"network\",\"P\":\"251\",\"T\":\"S\",\"V\":\"********\",\"S\":\"64\",\"H\":\"AP Password\",\"M\":\"0\"},{\"F\":\"network\",\"P\":\"329\",\"T\":\"B\",\"V\":\"2\",\"H\":\"AP IP Mode\",\"O\":[{\"DHCP\":\"1\"},{\"Static\":\"2\"}]},{\"F\":\"network\",\"P\":\"316\",\"T\":\"A\",\"V\":\"192.168.0.1\",\"H\":\"AP Static IP\"},{\"F\":\"network\",\"P\":\"320\",\"T\":\"A\",\"V\":\"255.255.255.0\",\"H\":\"AP Static Mask\"},{\"F\":\"network\",\"P\":\"324\",\"T\":\"A\",\"V\":\"192.168.0.1\",\"H\":\"AP Static Gateway\"},{\"F\":\"network\",\"P\":\"330\",\"T\":\"B\",\"V\":\"1\",\"H\":\"AP Network Mode\",\"O\":[{\"11b\":\"1\"},{\"11g\":\"2\"}]},{\"F\":\"printer\",\"P\":\"461\",\"T\":\"B\",\"V\":\"4\",\"H\":\"TargetFW\",\"O\":[{\"Repetier\":\"5\"},{\"Repetier for Davinci\":\"1\"},{\"Marlin\":\"2\"},{\"MarlinKimbra\":\"3\"},{\"Smoothieware\":\"4\"},{\"Unknown\":\"0\"}]},{\"F\":\"printer\",\"P\":\"129\",\"T\":\"B\",\"V\":\"3\",\"H\":\"Temperature Refresh Time\",\"S\":\"99\",\"M\":\"0\"},{\"F\":\"printer\",\"P\":\"164\",\"T\":\"I\",\"V\":\"1500\",\"H\":\"XY feedrate\",\"S\":\"9999\",\"M\":\"1\"},{\"F\":\"printer\",\"P\":\"168\",\"T\":\"I\",\"V\":\"110\",\"H\":\"Z feedrate\",\"S\":\"9999\",\"M\":\"1\"},{\"F\":\"printer\",\"P\":\"172\",\"T\":\"I\",\"V\":\"400\",\"H\":\"E feedrate\",\"S\":\"9999\",\"M\":\"1\"},{\"F\":\"printer\",\"P\":\"331\",\"T\":\"S\",\"V\":\"NO\",\"S\":\"128\",\"H\":\"Camera address\",\"M\":\"0\"},{\"F\":\"printer\",\"P\":\"460\",\"T\":\"B\",\"V\":\"3\",\"H\":\"Position Refresh Time\",\"S\":\"99\",\"M\":\"0\"}]}";
getESPsettingsSuccess(response_text);
return;
//endRemoveIf(production)
var url = "/command?plain="+encodeURIComponent("[ESP400]");
SendGetHttp(url, getESPsettingsSuccess, getESPsettingsfailed)
}
function build_select_for_setting_list(index){
var html = "<select class='form-control' id='setting_" + index + "' onchange='setting_checkchange(" + index +")' >";
for (var i = 0; i < setting_configList[index].Options.length ; i++){
html += "<option value='" + setting_configList[index].Options[i].id + "'";
if (setting_configList[index].Options[i].id == setting_configList[index].defaultvalue) html +=" selected ";
html += ">";
html += setting_configList[index].Options[i].display;
html += "</option>\n";
}
html += "</select>\n";
//console.log("default:" + setting_configList[index].defaultvalue);
//console.log(html);
return html;
}
function update_UI_setting(){
for (var i = 0; i < setting_configList.length ; i++){
switch (setting_configList[i].pos) {
//EP_E_FEEDRATE 172
case "172":
document.getElementById("extruder_velocity").value = setting_configList[i].defaultvalue;
break;
//EP_REFRESH_PAGE_TIME 129
case "129":
document.getElementById("tempInterval_check").value = setting_configList[i].defaultvalue;
break;
//EP_REFRESH_PAGE_TIME2 460
case "460":
document.getElementById("posInterval_check").value = setting_configList[i].defaultvalue;
break;
//EP_XY_FEEDRATE 164
case "164":
document.getElementById("control_xy_velocity").value = parseInt(setting_configList[i].defaultvalue);
break;
//EP_Z_FEEDRATE 168
case "168":
document.getElementById("control_z_velocity").value = setting_configList[i].defaultvalue;
break;
}
}
}
function build_HTML_setting_list(filter){
var content="";
current_setting_filter = filter;
document.getElementById(current_setting_filter+"_setting_filter").checked=true;
for (var i = 0; i < setting_configList.length ; i++){
if ((setting_configList[i].F.trim().toLowerCase() == filter) || (filter == "all")) {
content+="<tr>";
content+="<td style='vertical-align:middle'>";
content+=setting_configList[i].label;
content+="</td>";
content+="<td style='vertical-align:middle'>";
content+="<div class='input-group'>";
content+="<span class='input-group-btn'>";
content+="<button class='btn btn-default' onclick='setting_revert_to_default("+i+")' >";
content+=get_icon_svg("repeat");
content+="</button>";
content+="</span>";
content+="<div id='status_setting_"+ i + "' class='form-group has-feedback' >";
if (setting_configList[i].Options.length > 0){
content+=build_select_for_setting_list(i);
content+="<span id='icon_setting_"+ i + "'class='form-control-feedback' style='right: 1em'></span>";
}
else {
content+="<input id='setting_" + i + "' type='text' class='form-control' style='width:auto' value='" + setting_configList[i].defaultvalue + "' onkeyup='setting_checkchange(" + i +")' >";
content+="<span id='icon_setting_"+ i + "'class='form-control-feedback' ></span>";
}
content+="</div>";
content+="<span class='input-group-btn'>";
content+="<button id='btn_setting_"+ i + "' class='btn btn-default' onclick='settingsetvalue("+ i +")' translate english_content='Set' >" + translate_text_item("Set") + "</button>&nbsp;";
if (setting_configList[i].pos == "1") {
content+="<button class='btn btn-default' onclick='scanwifidlg(\"" + i +"\")'>";
content+=get_icon_svg("search");
content+="</button>";
}
content+="</span>";
content+="</div>";
content+="</td>";
content+="</tr>\n";
}
}
if (content.length > 0) document.getElementById('settings_list_data').innerHTML = content;
}
function setting_check_value(value, index){
var valid = true;
var entry = setting_configList[index];
//does it part of a list?
if(entry.Options.length > 0) {
var in_list = false;
for (var i = 0; i < entry.Options.length; i++){
if (entry.Options[i].id == value) in_list = true;
}
valid = in_list;
if(!valid)setting_error_msg = " in provided list";
}
//check byte / integer
if (entry.type == "B" || entry.type == "I"){
//cannot be empty
value.trim();
if (value.length == 0) valid = false;
//check minimum?
if (parseInt(entry.min_val) > parseInt(value)) valid = false;
//check maximum?
if (parseInt(entry.max_val) < parseInt(value)) valid = false;
if(!valid)setting_error_msg = " between " + entry.min_val + " and " + entry.max_val;
}
else if (entry.type == "S"){
//check minimum?
if (entry.min_val > value.length) valid = false;
//check maximum?
if (entry.max_val < value.length) valid = false;
if (value == "********")valid = false;
if(!valid)setting_error_msg = " between " + entry.min_val + " char(s) and " + entry.max_val + " char(s) long, and not '********'";
}
else if (entry.type == "A"){
//check ip address
var ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (!value.match(ipformat)) {
valid = false;
setting_error_msg = " a valid IP format (xxx.xxx.xxx.xxx)";
}
}
return valid;
}
function process_settings_answer(response_text) {
var result= true;
try {
var response = JSON.parse(response_text);
if(typeof response.EEPROM == 'undefined') {
result = false;
console.log('No EEPROM');
}
else {
//console.log("EEPROM has " + response.EEPROM.length + " entries");
if (response.EEPROM.length > 0) {
var vindex = 0;
for (var i = 0; i < response.EEPROM.length ; i++) {
vindex = create_setting_entry(response.EEPROM[i], vindex);
}
if (vindex > 0 ) {
build_HTML_setting_list(current_setting_filter);
update_UI_setting();
}
else result = false;
}
else result = false;
}
}
catch (e) {
console.error("Parsing error:", e);
result= false;
}
return result;
}
function create_setting_entry(sentry, vindex){
if (!is_setting_entry(sentry))return vindex;
var slabel = sentry.H;
var svalue = sentry.V;
var scmd = "[ESP401]P=" + sentry.P + " T=" + sentry.T + " V=";
var options = [];
var min;
var max;
if(typeof sentry.M !== 'undefined'){
min = sentry.M;
}
else {//add limit according the type
if (sentry.T == "B" ) min = -127
else if (sentry.T == "S" ) min = 0
else if (sentry.T == "A" ) min = 7
else if (sentry.T == "I" ) min = 0
}
if(typeof sentry.S !== 'undefined'){
max = sentry.S;
}
else {//add limit according the type
if (sentry.T == "B" ) max = 255;
else if (sentry.T == "S" ) max = 255;
else if (sentry.T == "A" ) max = 15;
else if (sentry.T == "I" ) max = 2147483647;
}
//list possible options if defined
if(typeof sentry.O !== 'undefined'){
for(var i in sentry.O){
var key = i;
var val = sentry.O[i];
for(var j in val){
var sub_key = j;
var sub_val = val[j];
var option = {id:sub_val, display:sub_key};
options.push(option);
//console.log(sub_key + " " + sub_val);
}
}
}
//create entry in list
var config_entry = {index: vindex, F:sentry.F, label: slabel, defaultvalue: svalue, cmd: scmd,Options:options, min_val:min, max_val:max, type:sentry.T, pos:sentry.P};
setting_configList.push(config_entry);
vindex++;
return vindex;
}
//check it is valid entry
function is_setting_entry(sline){
if(typeof sline.T === 'undefined' || typeof sline.V === 'undefined' || typeof sline.P === 'undefined' || typeof sline.H === 'undefined') {
return false
}
return true;
}
function setting_revert_to_default(index){
document.getElementById('setting_'+index).value = setting_configList[index].defaultvalue
document.getElementById('btn_setting_'+index).className = "btn btn-default";
document.getElementById('status_setting_'+index).className="form-group has-feedback";
document.getElementById('icon_setting_'+index).innerHTML="";
}
function settingsetvalue(index) {
//remove possible spaces
value = document.getElementById('setting_'+index).value.trim();
if (value == setting_configList[index].defaultvalue) return;
//check validity of value
var isvalid = setting_check_value(value, index);
//if not valid show error
if (!isvalid){
setsettingerror(index);
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be ") + setting_error_msg + " !");
} else {
//value is ok save it
var cmd = setting_configList[index].cmd + value;
setting_lastindex = index;
setting_configList[index].defaultvalue = value;
document.getElementById('btn_setting_'+index).className = "btn btn-success";
document.getElementById('icon_setting_'+index).className="form-control-feedback has-success";
document.getElementById('icon_setting_'+index).innerHTML=get_icon_svg("ok");
document.getElementById('status_setting_'+index).className="form-group has-feedback has-success";
var url = "/command?plain="+encodeURIComponent(cmd);
SendGetHttp(url, setESPsettingsSuccess, setESPsettingsfailed);
}
}
function setting_checkchange(index) {
//console.log("check " + "setting_"+index);
var val = document.getElementById('setting_'+index).value.trim();
//console.log("value: " + val);
if (setting_configList[index].defaultvalue == val){
document.getElementById('btn_setting_'+index).className = "btn btn-default";
document.getElementById('icon_setting_'+index).className="form-control-feedback";
document.getElementById('icon_setting_'+index).innerHTML="";
document.getElementById('status_setting_'+index).className="form-group has-feedback";
}
else if (setting_check_value(val, index)){
setsettingchanged(index);
//console.log("change ok");
}
else {
//console.log("change bad");
setsettingerror(index);
}
}
function setsettingchanged(index){
document.getElementById('status_setting_'+index).className="form-group has-feedback has-warning";
document.getElementById('btn_setting_'+index).className = "btn btn-warning";
document.getElementById('icon_setting_'+index).className="form-control-feedback has-warning";
document.getElementById('icon_setting_'+index).innerHTML=get_icon_svg("warning-sign");
}
function setsettingerror(index){
document.getElementById('btn_setting_'+index).className = "btn btn-danger";
document.getElementById('icon_setting_'+index).className="form-control-feedback has-error";
document.getElementById('icon_setting_'+index).innerHTML= get_icon_svg("remove");
document.getElementById('status_setting_'+index).className="form-group has-feedback has-error";
}
function setESPsettingsSuccess(response){
//console.log(response);
update_UI_setting();
}
function setESPsettingsfailed(error_code,response){
alertdlg (translate_text_item("Set failed"), "Error " + error_code + " :" + response);
console.log("Error " + error_code + " :" + response);
document.getElementById('btn_setting_'+setting_lastindex).className = "btn btn-danger";
document.getElementById('icon_setting_'+setting_lastindex).className="form-control-feedback has-error";
document.getElementById('icon_setting_'+setting_lastindex).innerHTML= get_icon_svg("remove");
document.getElementById('status_setting_'+setting_lastindex).className="form-group has-feedback has-error";
}
function getESPsettingsSuccess(response){
if (!process_settings_answer(response)){
getESPsettingsfailed(406, translate_text_item("Wrong data"));
console.log(response);
return;
}
document.getElementById('settings_loader').style.display="none";
document.getElementById('settings_list_content').style.display="block";
document.getElementById('settings_status').style.display="none";
document.getElementById('settings_refresh_btn').style.display="block";
}
function getESPsettingsfailed(error_code,response){
console.log("Error " + error_code + " :" + response);
document.getElementById('settings_loader').style.display="none";
document.getElementById('settings_status').style.display="block";
document.getElementById('settings_status').innerHTML=translate_text_item( "Failed:") + error_code + " " + response;
document.getElementById('settings_refresh_btn').style.display="block";
}
function restart_esp(){
confirmdlg(translate_text_item("Please Confirm"), translate_text_item("Restart ESP3D"), process_restart_esp);
}
function process_restart_esp(answer){
if (answer == "yes") {
restartdlg();
}
}

36
www/js/setup.js Normal file
View File

@@ -0,0 +1,36 @@
//setup dialog
function setupdlg () {
var modal = setactiveModal('setupdlg.html');
if ( modal == null) return;
showModal() ;
//removeIf(production)
return;
//endRemoveIf(production)
refreshsetup ();
}
function setupsuccess(response){
// console.log(response);
//removeIf(production)
return;
//endRemoveIf(production)
closeModal("setupion successful");
//setupfailed(500, "Wrong data")
}
function setupfailed(errorcode, response){
//document.getElementById('setupbtn').style.display='block';
//document.getElementById('failed_setup_msg').style.display='block';
//document.getElementById('setuping_msg').style.display='none';
console.log("Error " + errorcode + " : " + response);
}
function refreshsetup () {
document.getElementById('refreshsetupbtn').style.display='none';
//document.getElementById('failed_setup_msg').style.display='none';
//document.getElementById('setuping_msg').style.display='block';
// var url = "/command?plain="+encodeURIComponent("[ESP800]");;
//SendGetHttp(url, setupsuccess, setupfailed)
}

821
www/js/smoothie.js Normal file
View File

@@ -0,0 +1,821 @@
// MIT License:
//
// Copyright (c) 2010-2013, Joe Walnes
// 2013-2014, Drew Noakes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/**
* Smoothie Charts - http://smoothiecharts.org/
* (c) 2010-2013, Joe Walnes
* 2013-2014, Drew Noakes
*
* v1.0: Main charting library, by Joe Walnes
* v1.1: Auto scaling of axis, by Neil Dunn
* v1.2: fps (frames per second) option, by Mathias Petterson
* v1.3: Fix for divide by zero, by Paul Nikitochkin
* v1.4: Set minimum, top-scale padding, remove timeseries, add optional timer to reset bounds, by Kelley Reynolds
* v1.5: Set default frames per second to 50... smoother.
* .start(), .stop() methods for conserving CPU, by Dmitry Vyal
* options.interpolation = 'bezier' or 'line', by Dmitry Vyal
* options.maxValue to fix scale, by Dmitry Vyal
* v1.6: minValue/maxValue will always get converted to floats, by Przemek Matylla
* v1.7: options.grid.fillStyle may be a transparent color, by Dmitry A. Shashkin
* Smooth rescaling, by Kostas Michalopoulos
* v1.8: Set max length to customize number of live points in the dataset with options.maxDataSetLength, by Krishna Narni
* v1.9: Display timestamps along the bottom, by Nick and Stev-io
* (https://groups.google.com/forum/?fromgroups#!topic/smoothie-charts/-Ywse8FCpKI%5B1-25%5D)
* Refactored by Krishna Narni, to support timestamp formatting function
* v1.10: Switch to requestAnimationFrame, removed the now obsoleted options.fps, by Gergely Imreh
* v1.11: options.grid.sharpLines option added, by @drewnoakes
* Addressed warning seen in Firefox when seriesOption.fillStyle undefined, by @drewnoakes
* v1.12: Support for horizontalLines added, by @drewnoakes
* Support for yRangeFunction callback added, by @drewnoakes
* v1.13: Fixed typo (#32), by @alnikitich
* v1.14: Timer cleared when last TimeSeries removed (#23), by @davidgaleano
* Fixed diagonal line on chart at start/end of data stream, by @drewnoakes
* v1.15: Support for npm package (#18), by @dominictarr
* Fixed broken removeTimeSeries function (#24) by @davidgaleano
* Minor performance and tidying, by @drewnoakes
* v1.16: Bug fix introduced in v1.14 relating to timer creation/clearance (#23), by @drewnoakes
* TimeSeries.append now deals with out-of-order timestamps, and can merge duplicates, by @zacwitte (#12)
* Documentation and some local variable renaming for clarity, by @drewnoakes
* v1.17: Allow control over font size (#10), by @drewnoakes
* Timestamp text won't overlap, by @drewnoakes
* v1.18: Allow control of max/min label precision, by @drewnoakes
* Added 'borderVisible' chart option, by @drewnoakes
* Allow drawing series with fill but no stroke (line), by @drewnoakes
* v1.19: Avoid unnecessary repaints, and fixed flicker in old browsers having multiple charts in document (#40), by @asbai
* v1.20: Add SmoothieChart.getTimeSeriesOptions and SmoothieChart.bringToFront functions, by @drewnoakes
* v1.21: Add 'step' interpolation mode, by @drewnoakes
* v1.22: Add support for different pixel ratios. Also add optional y limit formatters, by @copacetic
* v1.23: Fix bug introduced in v1.22 (#44), by @drewnoakes
* v1.24: Fix bug introduced in v1.23, re-adding parseFloat to y-axis formatter defaults, by @siggy_sf
* v1.25: Fix bug seen when adding a data point to TimeSeries which is older than the current data, by @Nking92
* Draw time labels on top of series, by @comolosabia
* Add TimeSeries.clear function, by @drewnoakes
* v1.26: Add support for resizing on high device pixel ratio screens, by @copacetic
* v1.27: Fix bug introduced in v1.26 for non whole number devicePixelRatio values, by @zmbush
* v1.28: Add 'minValueScale' option, by @megawac
* Fix 'labelPos' for different size of 'minValueString' 'maxValueString', by @henryn
*/
;(function(exports) {
var Util = {
extend: function() {
arguments[0] = arguments[0] || {};
for (var i = 1; i < arguments.length; i++)
{
for (var key in arguments[i])
{
if (arguments[i].hasOwnProperty(key))
{
if (typeof(arguments[i][key]) === 'object') {
if (arguments[i][key] instanceof Array) {
arguments[0][key] = arguments[i][key];
} else {
arguments[0][key] = Util.extend(arguments[0][key], arguments[i][key]);
}
} else {
arguments[0][key] = arguments[i][key];
}
}
}
}
return arguments[0];
}
};
/**
* Initialises a new <code>TimeSeries</code> with optional data options.
*
* Options are of the form (defaults shown):
*
* <pre>
* {
* resetBounds: true, // enables/disables automatic scaling of the y-axis
* resetBoundsInterval: 3000 // the period between scaling calculations, in millis
* }
* </pre>
*
* Presentation options for TimeSeries are specified as an argument to <code>SmoothieChart.addTimeSeries</code>.
*
* @constructor
*/
function TimeSeries(options) {
this.options = Util.extend({}, TimeSeries.defaultOptions, options);
this.clear();
}
TimeSeries.defaultOptions = {
resetBoundsInterval: 3000,
resetBounds: true
};
/**
* Clears all data and state from this TimeSeries object.
*/
TimeSeries.prototype.clear = function() {
this.data = [];
this.maxValue = Number.NaN; // The maximum value ever seen in this TimeSeries.
this.minValue = Number.NaN; // The minimum value ever seen in this TimeSeries.
};
/**
* Recalculate the min/max values for this <code>TimeSeries</code> object.
*
* This causes the graph to scale itself in the y-axis.
*/
TimeSeries.prototype.resetBounds = function() {
if (this.data.length) {
// Walk through all data points, finding the min/max value
this.maxValue = this.data[0][1];
this.minValue = this.data[0][1];
for (var i = 1; i < this.data.length; i++) {
var value = this.data[i][1];
if (value > this.maxValue) {
this.maxValue = value;
}
if (value < this.minValue) {
this.minValue = value;
}
}
} else {
// No data exists, so set min/max to NaN
this.maxValue = Number.NaN;
this.minValue = Number.NaN;
}
};
/**
* Adds a new data point to the <code>TimeSeries</code>, preserving chronological order.
*
* @param timestamp the position, in time, of this data point
* @param value the value of this data point
* @param sumRepeatedTimeStampValues if <code>timestamp</code> has an exact match in the series, this flag controls
* whether it is replaced, or the values summed (defaults to false.)
*/
TimeSeries.prototype.append = function(timestamp, value, sumRepeatedTimeStampValues) {
// Rewind until we hit an older timestamp
var i = this.data.length - 1;
while (i >= 0 && this.data[i][0] > timestamp) {
i--;
}
if (i === -1) {
// This new item is the oldest data
this.data.splice(0, 0, [timestamp, value]);
} else if (this.data.length > 0 && this.data[i][0] === timestamp) {
// Update existing values in the array
if (sumRepeatedTimeStampValues) {
// Sum this value into the existing 'bucket'
this.data[i][1] += value;
value = this.data[i][1];
} else {
// Replace the previous value
this.data[i][1] = value;
}
} else if (i < this.data.length - 1) {
// Splice into the correct position to keep timestamps in order
this.data.splice(i + 1, 0, [timestamp, value]);
} else {
// Add to the end of the array
this.data.push([timestamp, value]);
}
this.maxValue = isNaN(this.maxValue) ? value : Math.max(this.maxValue, value);
this.minValue = isNaN(this.minValue) ? value : Math.min(this.minValue, value);
};
TimeSeries.prototype.dropOldData = function(oldestValidTime, maxDataSetLength) {
// We must always keep one expired data point as we need this to draw the
// line that comes into the chart from the left, but any points prior to that can be removed.
var removeCount = 0;
while (this.data.length - removeCount >= maxDataSetLength && this.data[removeCount + 1][0] < oldestValidTime) {
removeCount++;
}
if (removeCount !== 0) {
this.data.splice(0, removeCount);
}
};
/**
* Initialises a new <code>SmoothieChart</code>.
*
* Options are optional, and should be of the form below. Just specify the values you
* need and the rest will be given sensible defaults as shown:
*
* <pre>
* {
* minValue: undefined, // specify to clamp the lower y-axis to a given value
* maxValue: undefined, // specify to clamp the upper y-axis to a given value
* maxValueScale: 1, // allows proportional padding to be added above the chart. for 10% padding, specify 1.1.
* minValueScale: 1, // allows proportional padding to be added below the chart. for 10% padding, specify 1.1.
* yRangeFunction: undefined, // function({min: , max: }) { return {min: , max: }; }
* scaleSmoothing: 0.125, // controls the rate at which y-value zoom animation occurs
* millisPerPixel: 20, // sets the speed at which the chart pans by
* enableDpiScaling: true, // support rendering at different DPI depending on the device
* yMinFormatter: function(min, precision) { // callback function that formats the min y value label
* return parseFloat(min).toFixed(precision);
* },
* yMaxFormatter: function(max, precision) { // callback function that formats the max y value label
* return parseFloat(max).toFixed(precision);
* },
* maxDataSetLength: 2,
* interpolation: 'bezier' // one of 'bezier', 'linear', or 'step'
* timestampFormatter: null, // optional function to format time stamps for bottom of chart
* // you may use SmoothieChart.timeFormatter, or your own: function(date) { return ''; }
* scrollBackwards: false, // reverse the scroll direction of the chart
* horizontalLines: [], // [ { value: 0, color: '#ffffff', lineWidth: 1 } ]
* grid:
* {
* fillStyle: '#000000', // the background colour of the chart
* lineWidth: 1, // the pixel width of grid lines
* strokeStyle: '#777777', // colour of grid lines
* millisPerLine: 1000, // distance between vertical grid lines
* sharpLines: false, // controls whether grid lines are 1px sharp, or softened
* verticalSections: 2, // number of vertical sections marked out by horizontal grid lines
* borderVisible: true // whether the grid lines trace the border of the chart or not
* },
* labels
* {
* disabled: false, // enables/disables labels showing the min/max values
* fillStyle: '#ffffff', // colour for text of labels,
* fontSize: 15,
* fontFamily: 'sans-serif',
* precision: 2
* }
* }
* </pre>
*
* @constructor
*/
function SmoothieChart(options) {
this.options = Util.extend({}, SmoothieChart.defaultChartOptions, options);
this.seriesSet = [];
this.currentValueRange = 1;
this.currentVisMinValue = 0;
this.lastRenderTimeMillis = 0;
}
SmoothieChart.defaultChartOptions = {
millisPerPixel: 20,
enableDpiScaling: true,
yMinFormatter: function(min, precision) {
return parseFloat(min).toFixed(precision);
},
yMaxFormatter: function(max, precision) {
return parseFloat(max).toFixed(precision);
},
maxValueScale: 1,
minValueScale: 1,
interpolation: 'bezier',
scaleSmoothing: 0.125,
maxDataSetLength: 2,
scrollBackwards: false,
grid: {
fillStyle: '#ACACAC',
strokeStyle: '#777777',
lineWidth: 1,
sharpLines: false,
millisPerLine: 1000,
verticalSections: 2,
borderVisible: true
},
labels: {
fillStyle: '#ffffff',
disabled: false,
fontSize: 10,
fontFamily: 'monospace',
precision: 2
},
horizontalLines: []
};
// Based on http://inspirit.github.com/jsfeat/js/compatibility.js
SmoothieChart.AnimateCompatibility = (function() {
var requestAnimationFrame = function(callback, element) {
var requestAnimationFrame =
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback) {
return window.setTimeout(function() {
callback(new Date().getTime());
}, 16);
};
return requestAnimationFrame.call(window, callback, element);
},
cancelAnimationFrame = function(id) {
var cancelAnimationFrame =
window.cancelAnimationFrame ||
function(id) {
clearTimeout(id);
};
return cancelAnimationFrame.call(window, id);
};
return {
requestAnimationFrame: requestAnimationFrame,
cancelAnimationFrame: cancelAnimationFrame
};
})();
SmoothieChart.defaultSeriesPresentationOptions = {
lineWidth: 1,
strokeStyle: '#ffffff'
};
/**
* Adds a <code>TimeSeries</code> to this chart, with optional presentation options.
*
* Presentation options should be of the form (defaults shown):
*
* <pre>
* {
* lineWidth: 1,
* strokeStyle: '#ffffff',
* fillStyle: undefined
* }
* </pre>
*/
SmoothieChart.prototype.addTimeSeries = function(timeSeries, options) {
this.seriesSet.push({timeSeries: timeSeries, options: Util.extend({}, SmoothieChart.defaultSeriesPresentationOptions, options)});
if (timeSeries.options.resetBounds && timeSeries.options.resetBoundsInterval > 0) {
timeSeries.resetBoundsTimerId = setInterval(
function() {
timeSeries.resetBounds();
},
timeSeries.options.resetBoundsInterval
);
}
};
/**
* Removes the specified <code>TimeSeries</code> from the chart.
*/
SmoothieChart.prototype.removeTimeSeries = function(timeSeries) {
// Find the correct timeseries to remove, and remove it
var numSeries = this.seriesSet.length;
for (var i = 0; i < numSeries; i++) {
if (this.seriesSet[i].timeSeries === timeSeries) {
this.seriesSet.splice(i, 1);
break;
}
}
// If a timer was operating for that timeseries, remove it
if (timeSeries.resetBoundsTimerId) {
// Stop resetting the bounds, if we were
clearInterval(timeSeries.resetBoundsTimerId);
}
};
/**
* Gets render options for the specified <code>TimeSeries</code>.
*
* As you may use a single <code>TimeSeries</code> in multiple charts with different formatting in each usage,
* these settings are stored in the chart.
*/
SmoothieChart.prototype.getTimeSeriesOptions = function(timeSeries) {
// Find the correct timeseries to remove, and remove it
var numSeries = this.seriesSet.length;
for (var i = 0; i < numSeries; i++) {
if (this.seriesSet[i].timeSeries === timeSeries) {
return this.seriesSet[i].options;
}
}
};
/**
* Brings the specified <code>TimeSeries</code> to the top of the chart. It will be rendered last.
*/
SmoothieChart.prototype.bringToFront = function(timeSeries) {
// Find the correct timeseries to remove, and remove it
var numSeries = this.seriesSet.length;
for (var i = 0; i < numSeries; i++) {
if (this.seriesSet[i].timeSeries === timeSeries) {
var set = this.seriesSet.splice(i, 1);
this.seriesSet.push(set[0]);
break;
}
}
};
/**
* Instructs the <code>SmoothieChart</code> to start rendering to the provided canvas, with specified delay.
*
* @param canvas the target canvas element
* @param delayMillis an amount of time to wait before a data point is shown. This can prevent the end of the series
* from appearing on screen, with new values flashing into view, at the expense of some latency.
*/
SmoothieChart.prototype.streamTo = function(canvas, delayMillis) {
this.canvas = canvas;
this.delay = delayMillis;
this.start();
};
/**
* Make sure the canvas has the optimal resolution for the device's pixel ratio.
*/
SmoothieChart.prototype.resize = function() {
// TODO this function doesn't handle the value of enableDpiScaling changing during execution
if (!this.options.enableDpiScaling || !window || window.devicePixelRatio === 1)
return;
var dpr = window.devicePixelRatio;
var width = parseInt(this.canvas.getAttribute('width'));
var height = parseInt(this.canvas.getAttribute('height'));
if (!this.originalWidth || (Math.floor(this.originalWidth * dpr) !== width)) {
this.canvas.setAttribute('width', (Math.floor(width * dpr)).toString());
this.canvas.style.width = width + 'px';
this.canvas.getContext('2d').scale(dpr, dpr);
}
if (!this.originalHeight || (Math.floor(this.originalHeight * dpr) !== height)) {
this.originalHeight = height;
this.canvas.setAttribute('height', (Math.floor(height * dpr)).toString());
this.canvas.style.height = height + 'px';
this.canvas.getContext('2d').scale(dpr, dpr);
}
};
/**
* Starts the animation of this chart.
*/
SmoothieChart.prototype.start = function() {
if (this.frame) {
// We're already running, so just return
return;
}
// Renders a frame, and queues the next frame for later rendering
var animate = function() {
this.frame = SmoothieChart.AnimateCompatibility.requestAnimationFrame(function() {
this.render();
animate();
}.bind(this));
}.bind(this);
animate();
};
/**
* Stops the animation of this chart.
*/
SmoothieChart.prototype.stop = function() {
if (this.frame) {
SmoothieChart.AnimateCompatibility.cancelAnimationFrame(this.frame);
delete this.frame;
}
};
SmoothieChart.prototype.updateValueRange = function() {
// Calculate the current scale of the chart, from all time series.
var chartOptions = this.options,
chartMaxValue = Number.NaN,
chartMinValue = Number.NaN;
for (var d = 0; d < this.seriesSet.length; d++) {
// TODO(ndunn): We could calculate / track these values as they stream in.
var timeSeries = this.seriesSet[d].timeSeries;
if (!isNaN(timeSeries.maxValue)) {
chartMaxValue = !isNaN(chartMaxValue) ? Math.max(chartMaxValue, timeSeries.maxValue) : timeSeries.maxValue;
}
if (!isNaN(timeSeries.minValue)) {
chartMinValue = !isNaN(chartMinValue) ? Math.min(chartMinValue, timeSeries.minValue) : timeSeries.minValue;
}
}
// Scale the chartMaxValue to add padding at the top if required
if (chartOptions.maxValue != null) {
chartMaxValue = chartOptions.maxValue;
} else {
chartMaxValue *= chartOptions.maxValueScale;
}
// Set the minimum if we've specified one
if (chartOptions.minValue != null) {
chartMinValue = chartOptions.minValue;
} else {
chartMinValue -= Math.abs(chartMinValue * chartOptions.minValueScale - chartMinValue);
}
// If a custom range function is set, call it
if (this.options.yRangeFunction) {
var range = this.options.yRangeFunction({min: chartMinValue, max: chartMaxValue});
chartMinValue = range.min;
chartMaxValue = range.max;
}
if (!isNaN(chartMaxValue) && !isNaN(chartMinValue)) {
var targetValueRange = chartMaxValue - chartMinValue;
var valueRangeDiff = (targetValueRange - this.currentValueRange);
var minValueDiff = (chartMinValue - this.currentVisMinValue);
this.isAnimatingScale = Math.abs(valueRangeDiff) > 0.1 || Math.abs(minValueDiff) > 0.1;
this.currentValueRange += chartOptions.scaleSmoothing * valueRangeDiff;
this.currentVisMinValue += chartOptions.scaleSmoothing * minValueDiff;
}
this.valueRange = { min: chartMinValue, max: chartMaxValue };
};
SmoothieChart.prototype.render = function(canvas, time) {
var nowMillis = new Date().getTime();
if (!this.isAnimatingScale) {
// We're not animating. We can use the last render time and the scroll speed to work out whether
// we actually need to paint anything yet. If not, we can return immediately.
// Render at least every 1/6th of a second. The canvas may be resized, which there is
// no reliable way to detect.
var maxIdleMillis = Math.min(1000/6, this.options.millisPerPixel);
if (nowMillis - this.lastRenderTimeMillis < maxIdleMillis) {
return;
}
}
this.resize();
this.lastRenderTimeMillis = nowMillis;
canvas = canvas || this.canvas;
time = time || nowMillis - (this.delay || 0);
// Round time down to pixel granularity, so motion appears smoother.
time -= time % this.options.millisPerPixel;
var context = canvas.getContext('2d'),
chartOptions = this.options,
dimensions = { top: 0, left: 0, width: canvas.clientWidth, height: canvas.clientHeight },
// Calculate the threshold time for the oldest data points.
oldestValidTime = time - (dimensions.width * chartOptions.millisPerPixel),
valueToYPixel = function(value) {
var offset = value - this.currentVisMinValue;
return this.currentValueRange === 0
? dimensions.height
: dimensions.height - (Math.round((offset / this.currentValueRange) * dimensions.height));
}.bind(this),
timeToXPixel = function(t) {
if(chartOptions.scrollBackwards) {
return Math.round((time - t) / chartOptions.millisPerPixel);
}
return Math.round(dimensions.width - ((time - t) / chartOptions.millisPerPixel));
};
this.updateValueRange();
context.font = chartOptions.labels.fontSize + 'px ' + chartOptions.labels.fontFamily;
// Save the state of the canvas context, any transformations applied in this method
// will get removed from the stack at the end of this method when .restore() is called.
context.save();
// Move the origin.
context.translate(dimensions.left, dimensions.top);
// Create a clipped rectangle - anything we draw will be constrained to this rectangle.
// This prevents the occasional pixels from curves near the edges overrunning and creating
// screen cheese (that phrase should need no explanation).
context.beginPath();
context.rect(0, 0, dimensions.width, dimensions.height);
context.clip();
// Clear the working area.
context.save();
context.fillStyle = chartOptions.grid.fillStyle;
context.clearRect(0, 0, dimensions.width, dimensions.height);
context.fillRect(0, 0, dimensions.width, dimensions.height);
context.restore();
// Grid lines...
context.save();
context.lineWidth = chartOptions.grid.lineWidth;
context.strokeStyle = chartOptions.grid.strokeStyle;
// Vertical (time) dividers.
if (chartOptions.grid.millisPerLine > 0) {
context.beginPath();
for (var t = time - (time % chartOptions.grid.millisPerLine);
t >= oldestValidTime;
t -= chartOptions.grid.millisPerLine) {
var gx = timeToXPixel(t);
if (chartOptions.grid.sharpLines) {
gx -= 0.5;
}
context.moveTo(gx, 0);
context.lineTo(gx, dimensions.height);
}
context.stroke();
context.closePath();
}
// Horizontal (value) dividers.
for (var v = 1; v < chartOptions.grid.verticalSections; v++) {
var gy = Math.round(v * dimensions.height / chartOptions.grid.verticalSections);
if (chartOptions.grid.sharpLines) {
gy -= 0.5;
}
context.beginPath();
context.moveTo(0, gy);
context.lineTo(dimensions.width, gy);
context.stroke();
context.closePath();
}
// Bounding rectangle.
if (chartOptions.grid.borderVisible) {
context.beginPath();
context.strokeRect(0, 0, dimensions.width, dimensions.height);
context.closePath();
}
context.restore();
// Draw any horizontal lines...
if (chartOptions.horizontalLines && chartOptions.horizontalLines.length) {
for (var hl = 0; hl < chartOptions.horizontalLines.length; hl++) {
var line = chartOptions.horizontalLines[hl],
hly = Math.round(valueToYPixel(line.value)) - 0.5;
context.strokeStyle = line.color || '#ffffff';
context.lineWidth = line.lineWidth || 1;
context.beginPath();
context.moveTo(0, hly);
context.lineTo(dimensions.width, hly);
context.stroke();
context.closePath();
}
}
// For each data set...
for (var d = 0; d < this.seriesSet.length; d++) {
context.save();
var timeSeries = this.seriesSet[d].timeSeries,
dataSet = timeSeries.data,
seriesOptions = this.seriesSet[d].options;
// Delete old data that's moved off the left of the chart.
timeSeries.dropOldData(oldestValidTime, chartOptions.maxDataSetLength);
// Set style for this dataSet.
context.lineWidth = seriesOptions.lineWidth;
context.strokeStyle = seriesOptions.strokeStyle;
// Draw the line...
context.beginPath();
// Retain lastX, lastY for calculating the control points of bezier curves.
var firstX = 0, lastX = 0, lastY = 0;
for (var i = 0; i < dataSet.length && dataSet.length !== 1; i++) {
var x = timeToXPixel(dataSet[i][0]),
y = valueToYPixel(dataSet[i][1]);
if (i === 0) {
firstX = x;
context.moveTo(x, y);
} else {
switch (chartOptions.interpolation) {
case "linear":
case "line": {
context.lineTo(x,y);
break;
}
case "bezier":
default: {
// Great explanation of Bezier curves: http://en.wikipedia.org/wiki/Bezier_curve#Quadratic_curves
//
// Assuming A was the last point in the line plotted and B is the new point,
// we draw a curve with control points P and Q as below.
//
// A---P
// |
// |
// |
// Q---B
//
// Importantly, A and P are at the same y coordinate, as are B and Q. This is
// so adjacent curves appear to flow as one.
//
context.bezierCurveTo( // startPoint (A) is implicit from last iteration of loop
Math.round((lastX + x) / 2), lastY, // controlPoint1 (P)
Math.round((lastX + x)) / 2, y, // controlPoint2 (Q)
x, y); // endPoint (B)
break;
}
case "step": {
context.lineTo(x,lastY);
context.lineTo(x,y);
break;
}
}
}
lastX = x; lastY = y;
}
if (dataSet.length > 1) {
if (seriesOptions.fillStyle) {
// Close up the fill region.
context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, lastY);
context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, dimensions.height + seriesOptions.lineWidth + 1);
context.lineTo(firstX, dimensions.height + seriesOptions.lineWidth);
context.fillStyle = seriesOptions.fillStyle;
context.fill();
}
if (seriesOptions.strokeStyle && seriesOptions.strokeStyle !== 'none') {
context.stroke();
}
context.closePath();
}
context.restore();
}
// Draw the axis values on the chart.
if (!chartOptions.labels.disabled && !isNaN(this.valueRange.min) && !isNaN(this.valueRange.max)) {
var maxValueString = chartOptions.yMaxFormatter(this.valueRange.max, chartOptions.labels.precision),
minValueString = chartOptions.yMinFormatter(this.valueRange.min, chartOptions.labels.precision),
maxLabelPos = chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(maxValueString).width - 2,
minLabelPos = chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(minValueString).width - 2;
context.fillStyle = chartOptions.labels.fillStyle;
context.clearRect(0, 0, context.measureText(maxValueString).width +4, dimensions.height);
context.save();
context.lineWidth = chartOptions.grid.lineWidth;
context.strokeStyle = chartOptions.grid.strokeStyle;
context.beginPath();
context.moveTo(context.measureText(maxValueString).width +4, 0);
context.lineTo(context.measureText(maxValueString).width +4, dimensions.height);
context.lineTo(dimensions.width, dimensions.height);
context.stroke();
context.closePath();
context.restore();
//context.fillText(maxValueString, 2, chartOptions.labels.fontSize);
//context.fillText(minValueString/2, 2, dimensions.height - 2);
var i = (parseFloat(maxValueString) - parseFloat(minValueString)) / chartOptions.grid.verticalSections;
var h = dimensions.height / chartOptions.grid.verticalSections;
if (chartOptions.yMaxFormatter(this.valueRange.min , chartOptions.labels.precision) != chartOptions.yMaxFormatter(this.valueRange.min + i, chartOptions.labels.precision)) for (var p = 0; p < chartOptions.grid.verticalSections; p++){
context.fillText(chartOptions.yMaxFormatter(this.valueRange.min + (p*i), chartOptions.labels.precision), 2, dimensions.height - (p * h));
}
}
// Display timestamps along x-axis at the bottom of the chart.
if (chartOptions.timestampFormatter && chartOptions.grid.millisPerLine > 0) {
var textUntilX = chartOptions.scrollBackwards
? context.measureText(minValueString).width
: dimensions.width - context.measureText(minValueString).width + 4;
for (var t = time - (time % chartOptions.grid.millisPerLine);
t >= oldestValidTime;
t -= chartOptions.grid.millisPerLine) {
var gx = timeToXPixel(t);
// Only draw the timestamp if it won't overlap with the previously drawn one.
if ((!chartOptions.scrollBackwards && gx < textUntilX) || (chartOptions.scrollBackwards && gx > textUntilX)) {
// Formats the timestamp based on user specified formatting function
// SmoothieChart.timeFormatter function above is one such formatting option
var tx = new Date(t),
ts = chartOptions.timestampFormatter(tx),
tsWidth = context.measureText(ts).width;
textUntilX = chartOptions.scrollBackwards
? gx + tsWidth + 2
: gx - tsWidth - 2;
context.fillStyle = chartOptions.labels.fillStyle;
if(chartOptions.scrollBackwards) {
context.fillText(ts, gx, dimensions.height - 2);
} else {
context.fillText(ts, gx - tsWidth, dimensions.height - 2);
}
}
}
}
context.restore(); // See .save() above.
};
// Sample timestamp formatting function
SmoothieChart.timeFormatter = function(date) {
function pad2(number) { return (number < 10 ? '0' : '') + number }
return pad2(date.getHours()) + ':' + pad2(date.getMinutes()) + ':' + pad2(date.getSeconds());
};
exports.TimeSeries = TimeSeries;
exports.SmoothieChart = SmoothieChart;
})(typeof exports === 'undefined' ? this : exports);

48
www/js/statusdlg.js Normal file
View File

@@ -0,0 +1,48 @@
//status dialog
function statusdlg () {
var modal = setactiveModal('statusdlg.html');
if ( modal == null) return;
showModal() ;
refreshstatus ();
}
function statussuccess(response){
document.getElementById('refreshstatusbtn').style.display='block';
var modal = getactiveModal();
if ( modal == null) return;
var text = modal.element.getElementsByClassName("modal-text")[0];
var tresponse = response.split("\n");
var output = "";
for (var i = 0; i < tresponse.length; i++){
var data = tresponse[i].split(":",2);
if (data.length == 2) output+= "<label>" + data[0] + ": </label>&nbsp;<span class='text-info'><strong>" + data[1] +"</strong></span><br>";
else output+= tresponse[i]+ "<br>";
}
text.innerHTML= output;
//console.log(response);
}
function statusfailed(errorcode, response){
document.getElementById('refreshstatusbtn').style.display='block';
document.getElementById('status_msg').style.display='block';
console.log("Error " + errorcode + " : " + response);
document.getElementById('status_msg').innerHTML = "Error " + errorcode + " : " + response;
}
function refreshstatus() {
document.getElementById('refreshstatusbtn').style.display='none';
var modal = getactiveModal();
if ( modal == null) return;
var text = modal.element.getElementsByClassName("modal-text")[0];
text.innerHTML= "";
document.getElementById('status_msg').style.display='none';
//removeIf(production)
var response = "Chip ID: 13874112\nCPU Frequency: 160Mhz\nFree memory: 24.23 KB\nSDK: 2.0.0(656edbf)\nFlash Size: 4.00 MB\nAvailable Size for update: 652.17 KB(Ok)\nAvailable Size for SPIFFS: 3.00 MB\nBaud rate: 115200\nSleep mode: None\nChannel: 1\nPhy Mode: 11g\nWeb port: 80\nData port: 8888\nHostname: lucesp\nActive Mode: Station (5C:CF:7F:D3:B3:C0)\nConnected to: NETGEAR_2GEXT_OFFICE2\nSignal: 98%\nIP Mode: DHCP\nIP: 192.168.1.51\nGateway: 192.168.1.1\nMask: 255.255.255.0\nDNS: 192.168.1.1\nDisabled Mode: Access Point (5E:CF:7F:D3:B3:C0)\nCaptive portal: Enabled\nSSDP: Enabled\nNetBios: Enabled\nmDNS: Enabled\nWeb Update: Enabled\nPin Recovery: Disabled\nAuthentication: Disabled\nTarget Firmware: Smoothieware\nSD Card Support: Enabled\nFW version: 0.9.93\n";
statussuccess(response);
//statusfailed(500, "Error")
return;
//endRemoveIf(production)
var url = "/command?plain="+encodeURIComponent("[ESP420]plain");;
SendGetHttp(url, statussuccess, statusfailed)
}

13
www/js/tabs.js Normal file
View File

@@ -0,0 +1,13 @@
function opentab(evt, tabname) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabname).style.display = "block";
evt.currentTarget.className += " active";
}

225
www/js/temperatures.js Normal file
View File

@@ -0,0 +1,225 @@
var interval_temperature=-1;
var smoothieextuder = new SmoothieChart( {
millisPerPixel:200,
maxValueScale:1.1,
minValueScale: 1.1,
enableDpiScaling: false,
interpolation: 'linear',
grid:{
fillStyle:'#ffffff',
strokeStyle:'rgba(128,128,128,0.5)',
verticalSections:5.,
millisPerLine:0,
borderVisible: false
},
labels:{
fillStyle:'#000000',
precision:1
}
});
var smoothiebed = new SmoothieChart( {
millisPerPixel:200,
interpolation: 'linear',
maxValueScale:1.1,
minValueScale: 1.1,
enableDpiScaling: false,
grid:{
fillStyle:'#ffffff',
strokeStyle:'rgba(128,128,128,0.5)',
verticalSections:5.,
millisPerLine:0,
borderVisible: false
},
labels:{
fillStyle:'#000000',
precision:1
}
});
var extruder_0_line = new TimeSeries();
var extruder_1_line = new TimeSeries();
var bed_line = new TimeSeries();
function init_temperature_panel(){
var value = get_localdata('autocheck_temperature');
if (value == 'true'){
document.getElementById('autocheck_temperature').checked =true;
on_autocheck_temperature();
}
smoothiebed.addTimeSeries(bed_line,{lineWidth:1,strokeStyle:'#808080',fillStyle:'rgba(128,128,128,0.3)'});
smoothieextuder.addTimeSeries(extruder_0_line,{lineWidth:1,strokeStyle:'#ff8080',fillStyle:'rgba(255,128,128,0.3)'});
smoothieextuder.streamTo(document.getElementById("extruderTempgraph"),3000 /*delay*/);
smoothiebed.streamTo(document.getElementById("bedTempgraph"),3000 /*delay*/);
}
function temperature_second_extruder(enabled){
if (enabled){
smoothieextuder.addTimeSeries(extruder_1_line,{lineWidth:1,strokeStyle:'#000080'});
}
else {
smoothieextuder.removeTimeSeries(extruder_1_line);
}
}
function start_graph_output(){
document.getElementById('temperatures_output').style.display='block';
smoothieextuder.start();
smoothiebed.start();
}
function stop_graph_output(){
smoothieextuder.stop();
smoothiebed.stop();
}
function on_autocheck_temperature(){
if (document.getElementById('autocheck_temperature').checked) {
store_localdata('autocheck_temperature', true);
var interval = parseInt(document.getElementById('tempInterval_check').value);
if (!isNaN(interval) && interval > 0 && interval < 100) {
interval_temperature = setInterval(function(){ get_Temperatures() }, interval * 1000);
start_graph_output();
}
else {
document.getElementById('autocheck_temperature').checked = false;
store_localdata('autocheck_temperature', false);
document.getElementById('tempInterval_check').value = 0;
if (interval_temperature != -1 )clearInterval(interval_temperature);
interval_temperature = -1;
stop_graph_output();
}
}
else {
store_localdata('autocheck_temperature', false);
if (interval_temperature != -1 )clearInterval(interval_temperature);
interval_temperature = -1;
stop_graph_output();
}
}
function onTempIntervalChange(){
var interval = parseInt(document.getElementById('tempInterval_check').value);
if (!isNaN(interval) && interval > 0 && interval < 100 ) {
if (interval_temperature != -1 )clearInterval(interval_temperature);
interval_temperature = setInterval(function(){ get_Temperatures() }, interval * 1000);
}
else {
document.getElementById('autocheck_temperature').checked = false;
document.getElementById('tempInterval_check').value = 0;
if (interval != 0)alertdlg (translate_text_item("Out of range"), translate_text_item( "Value of auto-check must be between 0s and 99s !!"));
on_autocheck_temperature();
}
}
function get_Temperatures(){
var command = "M105";
//removeIf(production)
var response = "";
if (document.getElementById('autocheck_temperature').checked ) response = "ok T:26.4 /0.0 T1:26.4 /0.0 @0 B:24.9 /0.0 @0 \n";
else response = "ok T:26.4 /0.0 @0 B:24.9 /0.0 @0\n ";
process_Temperatures(response);
return;
//endRemoveIf(production)
SendPrinterCommand(command, false, process_Temperatures);
}
function process_Temperatures(response){
Monitor_output_Update(response);
var regex_temp = /(B|T(\d*)):\s*([+]?[0-9]*\.?[0-9]+)? (\/)([+]?[0-9]*\.?[0-9]+)?/gi;
var result;
var timedata = new Date().getTime();
while ((result = regex_temp.exec(response)) !== null) {
var tool = result[1];
var value = result[3] + "°C";
var value2;
if (isNaN(parseFloat(result[5]))) value2 = "0.0";
else value2 = result[5];
value += " | " + value2 + "°C";
if (tool == "T") {
//to push to graph
extruder_0_line.append(timedata, parseFloat(result[3]));
//test for second extruder
//extruder_1_line.append(timedata, parseFloat(result[3])+Math.random());
document.getElementById('heaterT0DisplayTemp').innerHTML = value;
//to see if heating or not
if (Number(value2) >0)document.getElementById('heaterT0TargetTemp_anime').style.display="block";
else document.getElementById('heaterT0TargetTemp_anime').style.display="none";
}
else if (tool == "T1") {
extruder_1_line.append(timedata, parseFloat(result[3]));
document.getElementById('heaterT1DisplayTemp').innerHTML = value;
if (Number(value2) >0)document.getElementById('heaterT1TargetTemp_anime').style.display="block";
else document.getElementById('heaterT1TargetTemp_anime').style.display="none";
}
if (tool == "B") {
bed_line.append(timedata, parseFloat(result[3]));
document.getElementById('bedDisplayTemp').innerHTML = value;
if (Number(value2) >0)document.getElementById('bedTargetTemp_anime').style.display="block";
else document.getElementById('bedTargetTemp_anime').style.display="none";
}
}
}
function temperature_heatOff(target){
switch (target) {
case 'T0':
document.getElementById('heaterT0SelectedTemp').value = 0;
document.getElementById('heaterT0TargetTemp_anime').style.display="none";
break;
case 'T1':
document.getElementById('heaterT1SelectedTemp').value = 0;
document.getElementById('heaterT1TargetTemp_anime').style.display="none";
break;
case 'bed':
document.getElementById('bedSelectedTemp').value = 0;
document.getElementById('bedTargetTemp_anime').style.display="none";
break;
}
var type = (target == 'bed')? 140 : 104;
var command = "M" + type + " S0";
if (target != 'bed'){
command+= " " + target;
}
SendPrinterCommand(command, true, get_Temperatures);
}
function temperature_handleKeyUp(event, target){
if (event.keyCode == 13) {
temperature_heatSet(target);
}
return true;
}
function temperature_heatSet(target){
var selectedTemp = 0;
switch (target) {
case 'T0':
selectedTemp = parseInt(document.getElementById('heaterT0SelectedTemp').value);
if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) {
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !"));
return;
}
break;
case 'T1':
selectedTemp = parseInt(document.getElementById('heaterT1SelectedTemp').value);
if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) {
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !"));
return;
}
break;
case 'bed':
selectedTemp = parseInt(document.getElementById('bedSelectedTemp').value);
if (selectedTemp < 0 || selectedTemp > 999 || isNaN(selectedTemp) || (selectedTemp === null)) {
alertdlg (translate_text_item("Out of range"), translate_text_item( "Value must be between 0 degres and 999 degres !"));
return;
}
break;
}
var type = (target == 'bed')? 140 : 104;
var command = "M" + type + " S" + selectedTemp;
if (target != 'bed'){
command+= " " + target;
}
SendPrinterCommand(command, true, get_Temperatures);
}

331
www/js/translate.js Normal file
View File

@@ -0,0 +1,331 @@
var language = 'en';
//french
var frenchtrans = {
"ESP3D for":"ESP3D pour",
"Value of auto-check must be between 0s and 99s !!":"La valeur de contr&ocirc;le doit &ecirc;tre entre 0s et 99s !!",
"Value of extruder velocity must be between1 mm/min and 9999 mm/min !":"La valeur de vitesse d'extrusion doit &ecirc;tre entre 1 mm/min et 9999 mm/min !",
"Value of filament length must be between 0.001 mm and 9999 mm !":"La valeur de distance d'extrusion doit &ecirc;tre entre 0.001 mm et 9999 mm !",
"cannot have '-', '#' char or be empty":"ne peut contenir les carat&egrave;res '-', '#' ou &ecirc;tre vide",
"cannot have '-', 'e' char or be empty":"ne peut contenir les carat&egrave;res '-', 'e' ou &ecirc;tre vide",
"Failed:":"Echec",
"File config / config.txt not found!":"Fichier config / config.txt non trouv&egrave;",
"File name cannot be empty!":"Le nom de fichier ne peut &ecirc;tre vide",
"Value must be ":"La valeur doit &ecirc;tre ",
"Value must be between 0 degres and 999 degres !":"La valeur doit &ecirc;tre entre 0 degr&egrave;s et 999 degr&egrave;s !",
"Value must be between 0% and 100% !":"La valeur doit &ecirc;tre entre 0% et 100% !",
"Value must be between 25% and 150% !":"La valeur doit &ecirc;tre entre 25% et 150% !",
"Value must be between 50% and 300% !":"La valeur doit &ecirc;tre entre 50% et 300%",
"XY feedrate value must be between 1 mm/min and 9999 mm/min !":"La valeur de l'acc&egrave;l&egrave;ration XY doit &ecirc;tre entre 1mm/min et 999mm/min !",
"Z feedrate value must be between 1 mm/min and 999 mm/min !":"La valeur de l'acc&egrave;l&egrave;ration Z doit &ecirc;tre entre 1mm/min et 999mm/min !",
" seconds":" secondes",
"Abort":"Stopper",
"auto-check every:":"Contr&ocirc;le toutes les:",
"auto-check position every:":"Contr&ocirc;le position toutes les:",
"Autoscroll":"D&eacute;filement auto",
"Bed":"Plateforme",
"Board":"Carte",
"Busy...":"Indisponible...",
"Camera":"Cam&eacute;ra",
"Cancel":"Annuler",
"Cannot get EEPROM content!":"Impossible d'obtenir le contenu de l'EEPROM",
"Clear":"Effacer",
"Close":"Fermer",
"Color":"Couleur",
"Commands":"Commandes",
"Communication locked by another process, retry later.":"Communication bloqu&eacute;e par un autre processus, essayez plus tard.",
"Communication locked!":"Communication bloqu&eacute;e!",
"Communications are currently locked, please wait and retry.":"Les communications sont actuellement bloqu&eacute;e, r&eacute;&eacute;ssayez plus tard!",
"Confirm deletion of directory: ":"Confirmez l'&eacute;ffacement du r&eacute;pertoire: ",
"Confirm deletion of file: ":"Confirmez l'&eacute;ffacement du fichier: ",
"Connecting ESP3D...":"Connection &agrave; ESP3D",
"Connection failed! is your FW correct?":"Impossible de se connecter! V&eacute;rifiez le micrologiciel",
"Controls":"Controles",
"Credits":"Cr&eacute;dits",
"Dashboard":"Tableau de bord",
"Data mofified":"Donn&eacute;es modifi&eacute;es",
"Do you want to save?":"Voulez-vous enregister?",
"enable second extruder":"activer second extrudeur",
"Error":"Erreur",
"ESP3D Filesystem":"Fichiers ESP3D",
"ESP3D Settings":"Param&egrave;tres ESP3D",
"ESP3D Status":"Etat ESP3D",
"ESP3D Update":"Mise &agrave; jour ESP3D",
"Extrude":"Extrusion",
"Extruder T0":"Extrudeur T0",
"Extruder T1":"Extrudeur T1",
"Extruders":"Extrudeurs",
"Fan (0-100%)":"Ventilateur (0-100%)",
"Feed (25-150%)":"Vitesse (25-150%)",
"Feedrate XY:":"Acc&eacute;l&eacute;ration XY:",
"Filename":"Fichier",
"Filter temperatures":"Filtrer temp&eacute;ratures",
"Firmware":"Micrologiciel",
"Flow (50-300%)":"D&eacute;bit (50-300%)",
"Heater T0":"Chauffage T0",
"Heater T1":"Chauffage T1",
"Help":"Aide",
"Icon":"Icone",
"Interface":"Interface",
"Join":"Connecter",
"Label":"Intitul&eacute;",
"List of available Access Points":"Points d'acc&egrave;s disponibles",
"Macro Editor":"Editeur de macro",
"mm":"mm",
"mm/min":"mm/min",
"Motors off":"Arr&ecirc;t Moteurs",
"Name":"Nom",
"Name:":"Nom:",
"Network":"R&eacute;seau",
"No SD card detected":"Pas de SD carte d&eacute;tect&eacute;e",
"No":"Non",
"Occupation:":"Occupation",
"Ok":"Ok",
"Options":"Options",
"Out of range":"Invalide",
"Please Confirm":"SVP Confirmez",
"Please enter directory name":"Entrez le nom du r&eacute;pertoire",
"Please wait...":"Patientez...",
"Printer configuration":"Configuration imprimante",
"Printer":"Imprimante",
"Progress":"Progression",
"Protected":"Prot&eacute;g&eacute;",
"Refresh":"Actualiser",
"Restart ESP3D":"Red&eacute;marrage ESP3D",
"Restarting ESP3D":"Red&eacute;marrage ESP3D",
"Restarting":"Red&eacute;marrage",
"Restarting, please wait....":"Red&eacute;marrage, patientez...",
"Retry":"R&eacute;&eacute;ssayer",
"Reverse":"Annuler",
"Save macro list failed!":"Echec enregistrement des macros",
"Save":"Enregistrer",
"Saving":"Enregistrement",
"Scanning":"Recherche",
"SD Files":"Fichiers de carte SD",
"sec":"sec",
"Send Command...":"Envoi Commande...",
"Send":"Envoyer",
"Set failed":"Echec enregistrement",
"Set":"Enregister",
"Signal":"Signal",
"Size":"Taille",
"SSID":"Identifiant",
"Target":"Emplacement",
"Temperatures":"Temp&eacute;ratures",
"Total:":"Total:",
"Type":"Type",
"Update Firmware ?":"MAJ Micrologiciel ?",
"Update is ongoing, please wait and retry.":"Mise &agrave; jour en cours, SVP attendez et r&eacute;essayez.",
"Update":"Mise &agrave; jour",
"Upload failed : ":"T&eacute;l&eacute;chargement annul&eacute;",
"Upload failed":"T&eacute;l&eacute;chargement annul&eacute;",
"Upload":"T&eacute;l&eacute;chargement",
"Uploading ":"T&eacute;l&eacute;chargement ",
"Upload done":"T&eacute;l&eacute;chargement termin&eacute;",
"Used:":"Utilis&eacute;:",
"Value | Target":"Actuel | Objectif",
"Value":"Valeur",
"Wrong data":"Donn&eacute;es invalides",
"Yes":"Oui"
};
//Spanish
var spanishtrans = {
"ESP3D for":"ESP3D para",
"Value of auto-check must be between 0s and 99s !!":"&iexcl;El valor del auto-control tiene que estar entre 0s y 99s !",
"Value of extruder velocity must be between1 mm/min and 9999 mm/min !":"&iexcl;El valor de la velocidad del extrusor tiene que estar entre 1 mm/min y 9999 mm/min ! ",
"Value of filament length must be between 0.001 mm and 9999 mm !":"&iexcl;El valor de la longitud de extrusi&oacute;n de filamento tiene que estar entre 0,001 mm y 9999 mm.!",
"cannot have '-', '#' char or be empty":"No puede tener el car&aacute;cter '-', '#' o estar vac&iacute;o",
"cannot have '-', 'e' char or be empty":"No puede tener el car&aacute;cter 'e', '#' o estar vac&iacute;o",
"Failed:":"Fracaso",
"File config / config.txt not found!":"&iexcl;No se encontr&oacute; el archivo config / config.txt.!",
"File name cannot be empty!":"&iexcl;El nombre del archivo no puede estar vac&iacute;o!",
"Value must be ":"El valor tiene que estar ",
"Value must be between 0 degres and 999 degres !":"&iexcl;El valor tiene que estar entre 0 grados y 999 grados!",
"Value must be between 0% and 100% !":"&iexcl;El valor tiene que estar entre 0% y 100% !",
"Value must be between 25% and 150% !":"&iexcl;El valor tiene que estar entre 25% y 150% !",
"Value must be between 50% and 300% !":"&iexcl;El valor tiene que estar entre 50% y 300%",
"XY feedrate value must be between 1 mm/min and 9999 mm/min !":"&iexcl;El valor de avance XY tiene que estar entre 1mm/min y 999mm/min !",
"Z feedrate value must be between 1 mm/min and 999 mm/min !":"&iexcl;El valor de avance Z tiene que estar entre doit &ecirc;tre entre 1mm/min y 999mm/min !",
" seconds":" secondos",
"Abort":"Interrumpir",
"auto-check every:":"Comprobar cada:",
"auto-check position every:":"Comprobar la posici&oacute;n cada:",
"Autoscroll":"Desplazamiento auto",
"Bed":"Base",
"Board":"Microcontrolador",
"Busy...":"Ocupado...",
"Camera":"C&aacute;mara",
"Cancel":"Cancelar",
"Cannot get EEPROM content!":"No se puede obtener contenido EEPROM!",
"Clear":"Borrar",
"Close":"Cerrar",
"Color":"Color",
"Commands":"Comandos",
"Communication locked by another process, retry later.":"Comunicaci&oacute;n bloqueada, espere",
"Communication locked!":"&iexcl;Comunicaci&oacute;n bloqueada!",
"Communications are currently locked, please wait and retry.":"Comunicaci&oacute;n bloqueada, espere y vuelva a intentarlo.",
"Confirm deletion of directory: ":"Confirmar eliminaci&oacute;n de carpeta: ",
"Confirm deletion of file: ":"Confirmar eliminaci&oacute;n de archivo: ",
"Connecting ESP3D...":"Conexi&oacute;n a ESP3D",
"Connection failed! is your FW correct?":"&iexcl;La conexi&oacute;n fall&oacute;! &iquest;Es el FW correcto",
"Controls":"Controles",
"Credits":"Cr&eacute;ditos",
"Dashboard":"Tablero",
"Data mofified":"Cambio de datos",
"Do you want to save?":" &iquest;Desea guardar ?",
"enable second extruder":"activar segundo extrusor",
"Error":"Error",
"ESP3D Filesystem":"Archivos ESP3D",
"ESP3D Settings":"Configuraci&oacute;n ESP3D",
"ESP3D Status":"Estado ESP3D",
"ESP3D Update":"Actualizaci&oacute;n ESP3D",
"Extrude":"Extrusi&oacute;n",
"Extruder T0":"Extrusor T0",
"Extruder T1":"Extrusor T1",
"Extruders":"Extrusores",
"Fan (0-100%)":"Ventilador (0-100%)",
"Feed (25-150%)":"Velocidad (25-150%)",
"Feedrate XY:":"Avance XY:",
"Filename":"Archivo",
"Filter temperatures":"Filtrar temperaturas",
"Firmware":"Firmware",
"Flow (50-300%)":"Flujo (50-300%)",
"Heater T0":"Calefactor T0",
"Heater T1":"Calefactor T1",
"Help":"Ayuda",
"Icon":"Representaci&oacute;n",
"Interface":"Interface",
"Join":"Unirse",
"Label":"Etiqueta",
"List of available Access Points":"Puntos de acceso disponibles",
"Macro Editor":"Macro editor",
"mm":"mm",
"mm/min":"mm/min",
"Motors off":"Apagar motores",
"Name":"Nombre",
"Name:":"Nombre:",
"Network":"Red",
"No SD card detected":"No se detecta la tarjeta SD",
"No":"No",
"Occupation:":"Ocupaci&oacute;n",
"Ok":"Ok",
"Options":"Opciones",
"Out of range":"No es v&aacute;lido",
"Please Confirm":"Por favor, confirma",
"Please enter directory name":"Por favor escriba el nombre de la carpeta",
"Please wait...":"Espere...",
"Printer configuration":"Configuraci&oacute;n de la impresora",
"Printer":"Impresora ",
"Progress":"Progreso",
"Protected":"Protegido",
"Refresh":"Actualizar",
"Restart ESP3D":"Reinicio ESP3D",
"Restarting ESP3D":"Reinicio ESP3D",
"Restarting":"Reinicio",
"Restarting, please wait....":"Reinicio, espere...",
"Retry":"Reintentar",
"Reverse":"Revocar",
"Save macro list failed!":"Fracaso de guardar la lista de macro",
"Save":"Guardar",
"Saving":"Guarda",
"Scanning":"Exploración",
"SD Files":"Archivos de tarjeta SD",
"sec":"sec",
"Send Command...":"Envia Comando...",
"Send":"Enviar",
"Set failed":"Fracaso guardar",
"Set":"Guardar",
"Signal":"Se&ntilde;al",
"Size":"Tama&ntilde;o",
"SSID":"Identificador",
"Target":"Localizaci&oacute;n",
"Temperatures":"Temperaturas",
"Total:":"Total:",
"Type":"Tipo",
"Update Firmware ?":"&iquest;Actualice el firmware ?",
"Update is ongoing, please wait and retry.":"Actualizaci&oacute;n en curso, espere y vuelva a intentarlo.",
"Update":"Actualizaci&oacute;n",
"Upload failed : ":"Carga fracasado :",
"Upload failed":"Carga fracasado",
"Upload":"Cargar",
"Uploading ":"Carga ",
"Upload done":"Carga terminado",
"Used:":"Utilizado:",
"Value | Target":"Actual | Objetivo",
"Value":"Valor",
"Wrong data":"Informaci&oacute;n incorrecta",
"Yes":"S&iacute;"
};
//removeIf(production)
var translated_list=[];
//endRemoveIf(production)
function translate_text(lang){
var currenttrans ={};
var translated_content="";
store_localdata('language',lang);
language = lang;
if (lang == 'fr') {
currenttrans = frenchtrans;
document.getElementById("translate_menu").innerHTML='Fran&ccedil;ais';
}
else if (lang == 'sp'){
currenttrans = spanishtrans
document.getElementById("translate_menu").innerHTML='Espa&ntilde;ol';
}
else {
document.getElementById("translate_menu").innerHTML='English';
}
var All = document.getElementsByTagName('*');
for (var i = 0; i < All.length; i++) {
if (All[i].hasAttribute( 'translate')) {
var content= "";
if (!All[i].hasAttribute( 'english_content')) {
content = All[i].innerHTML;
content.trim();
All[i].setAttribute( 'english_content', content);
//removeIf(production)
var item = {content:content};
translated_list.push(item);
//endRemoveIf(production)
}
content = All[i].getAttribute('english_content');
translated_content = translate_text_item(content);
All[i].innerHTML = translated_content;
}
//add support for placeholder attribut
if (All[i].hasAttribute( 'translateph') && All[i].hasAttribute( 'placeholder') ) {
var content= "";
if (!All[i].hasAttribute( 'english_content')) {
content = All[i].getAttribute('placeholder');
content.trim();
//removeIf(production)
var item = {content:content};
translated_list.push(item);
//endRemoveIf(production)
All[i].setAttribute( 'english_content', content);
}
content = All[i].getAttribute('english_content');
translated_content = translate_text_item(content);
All[i].setAttribute( 'placeholder', translated_content)
}
}
};
function translate_text_item( item_text) {
var currenttrans ={};
var translated_content;
if (language== 'fr') {
currenttrans = frenchtrans;
document.getElementById("translate_menu").innerHTML='Fran&ccedil;ais';
}
else if (language == 'sp'){
currenttrans = spanishtrans
document.getElementById("translate_menu").innerHTML='Espa&ntilde;ol';
}
if (language == 'en') translated_content = item_text;
else translated_content = currenttrans[item_text];
if (typeof translated_content === 'undefined' ) translated_content = item_text;
return translated_content;
}

101
www/js/updatedlg.js Normal file
View File

@@ -0,0 +1,101 @@
var update_ongoing=false;
var current_update_filename="";
//update dialog
function updatedlg () {
var modal = setactiveModal('updatedlg.html');
if ( modal == null) return;
document.getElementById('fw-select').style.display = 'block';
document.getElementById('prgfw').style.display = 'none';
document.getElementById('uploadfw-button').style.display = 'none';
document.getElementById('updatemsg').innerHTML = "";
document.getElementById('fw-select').value="";
showModal() ;
}
function closeUpdateDialog(msg){
if (update_ongoing) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Update is ongoing, please wait and retry."));
return;
}
closeModal(msg);
}
function checkupdatefile(){
var files = document.getElementById('fw-select').files;
document.getElementById('updatemsg').style.display='none';
if (files.length==0)document.getElementById('uploadfw-button').style.display = 'none';
else document.getElementById('uploadfw-button').style.display = 'block';
}
function UpdateProgressDisplay(oEvent){
if (oEvent.lengthComputable) {
var percentComplete = (oEvent.loaded / oEvent.total)*100;
document.getElementById('prgfw').value=percentComplete;
document.getElementById('updatemsg').innerHTML = translate_text_item("Uploading ") + current_update_filename + " " + percentComplete.toFixed(0)+"%" ;
} else {
// Impossible because size is unknown
}
}
function UploadUpdatefile() {
confirmdlg(translate_text_item("Please confirm"), translate_text_item("Update Firmware ?"), StartUploadUpdatefile)
}
function StartUploadUpdatefile( response) {
if (response != "yes") return;
if (http_communication_locked) {
alertdlg (translate_text_item("Busy..."), translate_text_item("Communications are currently locked, please wait and retry."));
return;
}
var files = document.getElementById('fw-select').files
var formData = new FormData();
var url = "/updatefw";
for (var i = 0; i < files.length; i++) {
var file = files[i];
formData.append('myfile[]', file, "/"+file.name);
}
document.getElementById('fw-select').style.display = 'none';
document.getElementById('uploadfw-button').style.display = 'none';
update_ongoing=true;
document.getElementById('updatemsg').style.display='block';
document.getElementById('prgfw').style.display = 'block';
if (files.length == 1)current_update_filename = files[0].name;
else current_update_filename = "";
document.getElementById('updatemsg').innerHTML = translate_text_item("Uploading ") + current_update_filename;
SendFileHttp(url, formData, UpdateProgressDisplay, updatesuccess, updatefailed)
}
function updatesuccess(response){
document.getElementById('updatemsg').innerHTML = translate_text_item("Restarting, please wait....");
document.getElementById('fw-select').value="";
var i = 0;
var interval;
var x = document.getElementById("prgfw");
x.max=40;
interval = setInterval(function(){
i=i+1;
var x = document.getElementById("prgfw");
x.value=i;
document.getElementById('updatemsg').innerHTML = translate_text_item("Restarting, please wait....") + (41-i) +translate_text_item(" seconds") ;
if (i>40)
{
update_ongoing=false;
clearInterval(interval);
location.reload();
}
},1000);
//console.log(response);
}
function updatefailed(errorcode, response){
document.getElementById('fw-select').style.display = 'block';
document.getElementById('prgfw').style.display = 'none';
document.getElementById('uploadfw-button').style.display = 'block';
document.getElementById('updatemsg').innerHTML = translate_text_item("Upload failed : ") + errorcode + " :" + response;
console.log("Error " + errorcode + " : " + response);
update_ongoing=false;
}

83
www/sub/SPIFFSdlg.html Normal file
View File

@@ -0,0 +1,83 @@
<!-- SPIFFS Modal -->
<div id="SPIFFSdlg.html" class="modal">
<!-- SPIFFS content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeSPIFFSDialog('cancel')"><b>&times;</b></span>
<h3><div class="modal-title" translate>ESP3D Filesystem</div></h3>
</div>
<div class="modal-body">
<div class="panel" id="SPIFFS">
<div class="panel-body">
<table>
<tr>
<td><input type="file" id="SPIFFS-select" name="myfiles[]" multiple onchange="checkSPIFFSfiles()" /></td>
<td>&nbsp;</td>
<td><button class="btn btn-primary" type="button" id="SPIFFS_uploadbtn" onclick="SPIFFS_UploadFile();" translate >Upload</button></td>
<td><progress style='display:none;' name='prg' id='SPIFFS_prg' max='100'></progress></td>
<td>&nbsp;</td>
<td><span id='uploadSPIFFSmsg' style='display:none;' translate>Uploading</span></td>
</tr>
</table>
<br><br>
<div class="panel">
<div class="panel-body">
<table>
<tr>
<td width="0%">
<button onclick="SPIFFS_Createdir()" class="btn btn-info" style="padding: 5px 8px 0px 8px;">
<svg width="2em" height="2em" viewBox="0 0 40 40">
<rect x="5" y="10" width="30" height="20" rx="2" ry="2" fill="currentColor" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" fill="currentColor" />
<text x="15" y="25" font-size="18" font-weight="800" fill="#5BC0DE">+</text>
</svg>
</button>
</td>
<td>
<div id="SPIFFS_loader" class="loader"></div>
</td>
<td width="100%">
<div id="SPIFFS_path" class="info" >&nbsp;</div>
</td>
</tr>
</table>
<table class="table table-striped" style="border:1px;solid #dddddd;margin-bottom:20px;" >
<thead>
<tr>
<th width='0%' translate>Type</th>
<th width='100%' translate>Name</th>
<th translate>Size</th>
<th width='0%'></th>
</tr>
</thead>
<tbody id="SPIFFS_file_list"></tbody>
</table>
</div>
<div class="panel-footer" id="SPIFFS_status"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeSPIFFSDialog('cancel') " translate>Close</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" id="refreshSPIFFSbtn" onclick="refreshSPIFFS() ">
<svg width="1.3em" height="1.2em" viewBox="0 0 1300 1200">
<g transform="translate(50,1200) scale(1, -1)">
<path fill="currentColor" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z" />
</g>
</svg>
</button>
</span>
</div>
</div>
<!-- /SPIFFS content -->
</div>
<!-- /SPIFFS Modal -->

28
www/sub/alertdlg.html Normal file
View File

@@ -0,0 +1,28 @@
<!-- alert Modal -->
<div id="alertdlg.html" class="modal topmodal">
<!-- alert content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title"></div></h3>
</div>
<div class="modal-body">
<span>
<span>
<svg width='26px' height='24px' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='red' d='M-90 100l642 1066q20 31 48 28.5t48 -35.5l642 -1056q21 -32 7.5 -67.5t-50.5 -35.5h-1294q-37 0 -50.5 34t7.5 66zM155 200h345v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h345l-445 723zM496 700h208q20 0 32 -14.5t8 -34.5l-58 -252 q-4 -20 -21.5 -34.5t-37.5 -14.5h-54q-20 0 -37.5 14.5t-21.5 34.5l-58 252q-4 20 8 34.5t32 14.5z' />
</g>
</svg>
</span>
&nbsp;&nbsp;
<span class="modal-text"></span>
</span>
</div>
<div class="modal-footer">
<span class="pull-right"><button class="btn btn-primary" onclick="closeModal('Ok') " translate>Ok</button></span>
</div>
</div>
<!-- /alert content -->
</div>
<!-- /alert Modal -->

46
www/sub/cameratab.html Normal file
View File

@@ -0,0 +1,46 @@
<div id="cameratab" class="tabcontent">
<center>
<br>
<form class="form-inline">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">@</div>
<input type="text" class="form-control" id="camera_webaddress" style="width:50em" onkeyup="camera_OnKeyUp(event)" placeholder="address of camera">
</div>
</div>
<button type="button" class="btn btn-primary" onclick="camera_loadframe();">
<span><svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'><g transform='translate(50,1200) scale(1, -1)'><path fill='currentColor' d='M639 1109l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291q-94 -2 -182 -20t-170.5 -52t-147 -92.5t-100.5 -135.5q5 105 27 193.5t67.5 167t113 135t167 91.5t225.5 42v262q0 21 11.5 26t27.5 -8z' /></g></svg></span>
</button>
<button type="button" class="btn btn-info" onclick="camera_GetAddress();">
<span>
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'><g transform='translate(50,1200) scale(1, -1)'><path fill='currentColor' d='M583 1182l378 -435q14 -15 9 -31t-26 -16h-244v-250q0 -20 -17 -35t-39 -15h-200q-20 0 -32 14.5t-12 35.5v250h-250q-20 0 -25.5 16.5t8.5 31.5l383 431q14 16 33.5 17t33.5 -14zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z' /></g></svg>
</span>
</button>
<button type="button" class="btn btn-warning" onclick="camera_saveaddress();">
<span><svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'><g transform='translate(50,1200) scale(1, -1)'><path fill='currentColor' d='M450 1200h200q21 0 35.5 -14.5t14.5 -35.5v-350h245q20 0 25 -11t-9 -26l-383 -426q-14 -15 -33.5 -15t-32.5 15l-379 426q-13 15 -8.5 26t25.5 11h250v350q0 21 14.5 35.5t35.5 14.5zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z' /></g></svg>
</span>
</button>
</form>
<br>
<table id="camera_frame_display">
<tr>
<td width="100%">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" id="camera_frame"></iframe>
</div>
</td>
<td valign="top">
<button type="button" onclick="camera_detachcam()">
<span>
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'><g transform='translate(50,1200) scale(1, -1)'><path fill='currentColor' d='M750 1200h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -10.5 -25t-24.5 10l-109 109l-312 -312q-15 -15 -35.5 -15t-35.5 15l-141 141q-15 15 -15 35.5t15 35.5l312 312l-109 109q-14 14 -10 24.5t25 10.5zM456 900h-156q-41 0 -70.5 -29.5t-29.5 -70.5v-500 q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v148l200 200v-298q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5h300z' /></g></svg>
</span>
</button>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</tr>
</table>
</center>
</div>

38
www/sub/commandpanel.html Normal file
View File

@@ -0,0 +1,38 @@
<div class="panel panel-default">
<div class="panel-heading">
<span translate>Commands</span>
<button class="btn btn-primary btn-xs pull-right" onclick="Monitor_output_Clear()" translate>Clear</button>
</div>
<div class="panel-body" >
<pre id="cmd_content" style="min-height: 260px; max-height: 260px;" ></pre>
</div>
<div class="panel-footer" >
<div class="form-inline">
<div class='input-group'>
<div class='input-group'>
<input class='form-control' type="text" onkeyup="CustomCommand_OnKeyUp(event)" id="custom_cmd_txt" autocomplete="off" translateph placeholder='Send Command...' />
<div class='input-group-btn'>
<button class="btn btn-success" onclick="SendCustomCommand();" translate>Send</button>
</div>
</div>
</div>
<div class="form-group" style="margin-left:20px">
<div class="checkbox" >
<label>
<input type="checkbox" onclick=" Monitor_check_autoscroll()" id="monitor_enable_autoscroll" />
<span translate>Autoscroll</span>
</label>
</div>
</div>
<div class="form-group" style="margin-left:20px">
<div class="checkbox">
<label>
<input type="checkbox" onclick=" Monitor_check_filter_temperatures()" id="monitor_enable_filter_temperatures" />
<span translate>Filter temperatures</span>
</label>
</div>
</div>
</div>
</div>
</div>

30
www/sub/configtab.html Normal file
View File

@@ -0,0 +1,30 @@
<div id="configtab" class="tabcontent">
<center>
<h2>
<span translate>Printer configuration</span>
</h2>
<button type="button" id="config_refresh_btn" class="btn btn-primary" onclick="refreshconfig();">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill="currentColor" d='M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z' />
</g>
</svg>
</button>
<br>
<span id="config_status"></span>
<hr>
<div class="loader hide_it" id="config_loader"></div>
<div class="hide_it" id="config_list_content" >
<table class="table table-bordered table-striped table-hover" style='width:auto; max-width: 90% !important; word-wrap: break-word;'>
<thead>
<tr>
<th translate>Label</th>
<th translate>Value</th>
<th translate>Help</th>
</tr>
</thead>
<tbody id="config_list_data"></tbody>
</table>
</div>
</center>
</div>

34
www/sub/confirmdlg.html Normal file
View File

@@ -0,0 +1,34 @@
<!-- alert Modal -->
<div id="confirmdlg.html" class="modal topmodal">
<!-- alert content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title"></div></h3>
</div>
<div class="modal-body">
<span>
<svg width='26px' height='24px' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='#337ab7' d='M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM588 941q-29 0 -59 -5.5t-63 -20.5t-58 -38.5t-41.5 -63t-16.5 -89.5 q0 -25 20 -25h131q30 -5 35 11q6 20 20.5 28t45.5 8q20 0 31.5 -10.5t11.5 -28.5q0 -23 -7 -34t-26 -18q-1 0 -13.5 -4t-19.5 -7.5t-20 -10.5t-22 -17t-18.5 -24t-15.5 -35t-8 -46q-1 -8 5.5 -16.5t20.5 -8.5h173q7 0 22 8t35 28t37.5 48t29.5 74t12 100q0 47 -17 83 t-42.5 57t-59.5 34.5t-64 18t-59 4.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z' />
</g>
</svg>
&nbsp;&nbsp;
<span class="modal-text"></span>
</span>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-primary" onclick="closeModal('yes');" translate>Yes</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-warning" onclick="closeModal('no');" translate>No</button>
</span>
</div>
</div>
<!-- /alert content -->
</div>
<!-- /alert Modal -->

25
www/sub/connectdlg.html Normal file
View File

@@ -0,0 +1,25 @@
<!-- Connect Modal -->
<div id="connectdlg.html" class="modal">
<!-- Connect content -->
<div class="modal-content">
<div class="modal-header">
<h3><div class="modal-title" translate>Connecting ESP3D...</div></h3>
</div>
<div class="modal-body">
<center>
<span id="connecting_msg">
<span translate>Please wait...</span>
<progress></progress>
</span>
<span class="hide_it" id="failed_connect_msg">
<span translate>Connection failed! is your FW correct?</span>
</span>
</center>
</div>
<div class="modal-footer">
<center><button class="btn btn-primary" id="connectbtn" onclick="retryconnect() " translate>Retry</button></center>
</div>
</div>
<!-- /Connect content -->
</div>
<!-- /Connect Modal -->

101
www/sub/controlspanel.html Normal file
View File

@@ -0,0 +1,101 @@
<div class="panel panel-default" >
<div class="panel-heading">
<div class="row">
<div class="col-md-12">
<div class="pull-left" >
<span translate>Controls</span>
</div>
<div class="pull-right">
<div class="form-inline">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" id="autocheck_position" onclick="on_autocheck_position()"/>
<span translate>auto-check position every:</span>
</label>
<input class='form-control' type="number" min="1" max="99" style="width:4em" id="posInterval_check" onchange="onPosIntervalChange()"/>
<span translate>sec</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col col-lg-7">
<!-- replaceSVG --><object data="images/jogdial.svg" type="image/svg+xml" ></object><!-- /replaceSVG -->
</div>
<div class="col col-lg-4">
<table>
<tr>
<td valign="top">
<table class="table table-borderless">
<thead style='border:none'>
<tr>
<th>
<button class="btn btn-primary" onclick="showmacrodlg(processMacroSave)">
<span class="badge">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429z' />
</g>
</svg>
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M1011 1210q19 0 33 -13l153 -153q13 -14 13 -33t-13 -33l-99 -92l-214 214l95 96q13 14 32 14zM1013 800l-615 -614l-214 214l614 614zM317 96l-333 -112l110 335z' />
</g>
</svg>
</span>
</button>
</th>
</tr>
</thead>
<tbody id="Macro_col1" style='border:none'>
</tbody>
</table>
</td>
<td valign="top">
<table class="table table-borderless">
<tbody id="Macro_col2" style='border:none'>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="hide_it2" id="positions_labels">
<h4>&nbsp;&nbsp;&nbsp;
<span class="label label-default">X:<span id ="control_x_position"></span></span>
&nbsp;&nbsp;
<span class="label label-default">Y:<span id="control_y_position"></span></span>
&nbsp;&nbsp;
<span class="label label-default">Z:<span id="control_z_position"></span></span>
</h4>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-md-12">
<div class="form-inline">
<div class="form-group">
<span translate>Feedrate XY:</span>&nbsp;
<input class='form-control' type="number" min="1" max="9999" id="control_xy_velocity" onchange="onXYvelocityChange()" style="width: 6em;"/>
&nbsp;<span translate>mm/min</span>
&nbsp;Z:&nbsp;
<input class='form-control' type="number" min="1" max="999" id="control_z_velocity" onchange="onZvelocityChange()" style="width:5em" />
&nbsp;<span translate>mm/min</span>
&nbsp;&nbsp;
<button class="btn btn-primary pull-right" onclick="control_motorsOff()" translate>Motors off</button>
</div>
</div>
</div>
</div>
</div>
</div>

24
www/sub/creditsdlg.html Normal file
View File

@@ -0,0 +1,24 @@
<!-- Credits Modal -->
<div id="creditsdlg.html" class="modal">
<!-- Credits content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title" translate>Credits</div></h3>
</div>
<div class="modal-body">
<span>
<ul>
<li>Thanks to <a href='https://github.com/imrahil/smoothieware-webui' target='_blank'>imrahil/smoothieware-webui</a> for the inspiration and the code base.</li>
<li>Current UI use a customized version of <a href='http://getbootstrap.com' target='_blank'>bootstrap</a> including a local limited version of svg version of<a href='http://glyphicons.com/' target='_blank'> Glyphicons Halflings</a> to get a small footprint.</li>
<li>A customized version of <a href='http://smoothiecharts.org/' target='_blank'>smoothiecharts</a> is used to display temperatures charts, it is simple and perfectly sized for the current purpose.</li>
</ul>
</span>
</div>
<div class="modal-footer">
<span class="pull-right"><button class="btn btn-primary" onclick="closeModal('Ok') " translate>Ok</button></span>
</div>
</div>
<!-- /Credits content -->
</div>
<!-- /Credits Modal -->

25
www/sub/dashtab.html Normal file
View File

@@ -0,0 +1,25 @@
<div id="maintab" class="tabcontent">
<div class="container-fluid">
<div class="row equal">
<div id="controlPanel" class="col-md-6 col-sm-6" >
<file-include w3-include-html="'sub/controlspanel.html'"></file-include>
</div>
<div id="tempPanel" class="col-md-6 col-sm-6">
<file-include w3-include-html="'sub/temperaturepanel.html'"></file-include>
</div>
</div>
<div class="row equal">
<div id="extruderPanel" class="col-md-6 col-sm-6" >
<file-include w3-include-html="'sub/extruderpanel.html'"></file-include>
</div>
<div id="filePanel" class="col-md-6 col-sm-6" >
<file-include w3-include-html="'sub/files.html'"></file-include>
</div>
</div>
<div class="row equal">
<div id="commandsPanel" class="col-md-6 col-sm-6" >
<file-include w3-include-html="'sub/commandpanel.html'"></file-include>
</div>
</div>
</div>
</div>

142
www/sub/extruderpanel.html Normal file
View File

@@ -0,0 +1,142 @@
<div class="panel panel-default" style ="min-width:400px">
<div class="panel-heading">
<div class="row">
<div class="col-md-12">
<div class="pull-left" >
<span translate>Extruders</span>
</div>
<div class="pull-right">
<div class="form-inline">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" id="enable_second_extruder" onclick="update_second_extruder()"/>
<span translate>enable second extruder</span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body panel-height">
<table class="table">
<thead>
<tr>
<th translate>Name</th>
<th colspan="2" translate>Options</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-lg-4" translate>Extruder T0</td>
<td>
<div class="form-inline">
<div class="form-group">
<button onclick="Extrude_cmd('T0', 1)" class="btn btn-primary" translate>Extrude</button>
<button onclick="Extrude_cmd('T0', -1)" class="btn btn-info" translate>Reverse</button>
</div>
</div>
</td>
</tr>
<tr id="second_extruder_UI" class="hide_it">
<td translate class="col-lg-3 col-md-3" >Extruder T1</td>
<td class="col-lg-6">
<div class="form-inline">
<div class="form-group">
<button onclick="Extrude_cmd('T1', 1)" class="btn btn-primary" translate>Extrude</button>
<button onclick="Extrude_cmd('T1', -1)" class="btn btn-info" translate>Reverse</button>
</div>
</div>
</td>
</tr>
<tr>
<td class="col-lg-3 col-md-3" translate>Flow (50-300%)</td>
<td class="col-lg-6">
<div class="form-inline">
<div class="form-group">
<button onclick="flowInit_cmd()" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="50" max="300" id="flowSelectedValue" onkeyup="extruder_handleKeyUp(event, 'Flow')" value=100>&#37;&nbsp;&nbsp;
<button onclick="flowSet_cmd()" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
</tr>
<tr>
<td class="col-lg-3 col-md-3" translate>Feed (25-150%)</td>
<td class="col-lg-6">
<div class="form-inline">
<div class="form-group">
<button onclick="feedInit_cmd()" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="25" max="150" id="feedSelectedValue" value=100 onkeyup="extruder_handleKeyUp(event, 'Feed')">&#37;&nbsp;&nbsp;
<button onclick="feedSet_cmd()" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
</tr>
<tr>
<td class="col-lg-3 col-md-3" translate>Fan (0-100%)</td>
<td class="col-lg-6">
<div class="form-inline">
<div class="form-group">
<button onclick="fanOff_cmd()" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="0" max="100" value=0 id="fanSelectedValue" onkeyup="extruder_handleKeyUp(event, 'Fan')">&#37;&nbsp;&nbsp;
<button onclick="fanSet_cmd()" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel-footer" >
<div class="row">
<div class="col-md-12" >
<div class="form-inline">
<div class="form-group">
<span translate>Extrude</span>
<input class='form-control' type="number" min="1" max="9999" style="width:4em" onchange='on_extruder_length_Change()' onkeyup="on_extruder_length_Change()" id="filament_length" value=5>&nbsp;<span translate>mm</span> @
<input class='form-control' type="number" min="1" max="9999" onkeyup="on_extruder_velocity_Change()" style="width:5em" id="extruder_velocity">&nbsp;<span translate>mm/min</span>
</div>
</div>
</div>
</div>
</div>
</div>

86
www/sub/files.html Normal file
View File

@@ -0,0 +1,86 @@
<div class="panel panel-default" style ="min-width:400px">
<div class="panel-heading">
<div class="row">
<div class="col-md-12">
<div class="pull-left" >
<table >
<tr>
<td><span translate>SD Files</span></td>
<td>&nbsp;&nbsp;</td>
<td>
<button id="files_createdir_btn" onclick="files_Createdir()" class="btn btn-info btn-xs hide_it" style="padding: -2px 2px 0x 0px;">
<svg width="1.5em" height="1.2em" viewBox="5 10 30 10">
<rect x="5" y="10" width="30" height="20" rx="2" ry="2" fill="currentColor" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" fill="currentColor" />
<text x="15" y="25" font-size="18" font-weight="800" fill="#5BC0DE">+</text>
</svg>
</button>
</td>
<td>&nbsp;&nbsp;</td>
<td><span id="files_currentPath" ></span></td>
<td>&nbsp;&nbsp;</td>
<td><div id="files_nav_loader" style="width:1em;height:1em" class="loader"></div></td>
<tr>
</table>
</div>
<div class="hide_it pull-right" id="files_uploading_msg">
<table>
<tr>
<td><span translate>Uploading </span></td>
<td>&nbsp;</td>
<td><span class="text-info" id="files_currentUpload_msg"></span></td>
<td>&nbsp;</td>
<td width='100px'><progress name='prg' id='files_prg' max='100'></progress></td>
<td><span id="files_percent_upload"></span>%</td>
</tr>
</table>
</div>
<div class="pull-right" id="files_navigation_buttons">
<button class="btn btn-xs btn-primary" onclick="files_filter_button(this);">
<span id="files_filter_glyph" style="position:relative; top:2px">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M150 1200h900q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM700 500v-300l-200 -200v500l-350 500h900z' />
</g>
</svg>
</span>
</button>
<button class="btn btn-xs btn-primary hide_it" id="files_refresh_btn" onclick="files_refreshFiles(files_currentPath)" translate>Refresh</button>
<button class="btn btn-xs btn-primary hide_it" id="files_refresh_primary_sd_btn" onclick="files_refreshFiles(primary_sd)" >SD 1</button>
<button class="btn btn-xs btn-primary hide_it" id="files_refresh_secondary_sd_btn" onclick="files_refreshFiles(secondary_sd)" >SD 2</button>
<button class="btn btn-xs btn-primary" onclick="files_progress()" translate>Progress</button>
<button class="btn btn-xs btn-primary" onclick="files_abort()" translate>Abort</button>
<button class="btn btn-xs btn-primary" onclick="files_select_upload()" translate>Upload</button>
<input type="file" id="files_input_file" onchange="files_check_if_upload()" accept=" .g, .gco, .gcode, .G, .GCO, .GCODE" style="display:none" />
</div>
</div>
</div>
</div>
<div class="panel-body panel-height panel-max-height panel-scroll">
<div id="files_list_loader" class="loader" style="margin:auto"></div>
<ul class="list-group" id="files_fileList">
</ul>
</div>
<div class="panel-footer panel-footer-height">
<div class="row">
<div class="col-md-12" >
<table>
<tr id="files_space_sd_status" class="hide_it">
<td><span translate>Total:</span>&nbsp;<span id="files_sd_status_total"></span></td>
<td>&nbsp;| <span translate>Used:</span>&nbsp;<span id="files_sd_status_used"> </span></td>
<td>&nbsp;| <span translate>Ocupation:</span>&nbsp;</td>
<td >
<meter id="files_sd_status_occupation" style='width:150px' min='0' max='100' high='90' value=50></meter>
</td>
<td><span id="files_sd_status_percent"></span><span>%</span></td>
</tr>
<tr id="files_status_sd_status" class="hide_it">
<td>
<span id="files_sd_status_msg">Ok</span>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>

30
www/sub/inputdlg.html Normal file
View File

@@ -0,0 +1,30 @@
<!-- input Modal -->
<div id="inputdlg.html" class="modal topmodal">
<!-- input content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeInputModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title"></div></h3>
</div>
<div class="modal-body">
<span>
<span class="modal-text">
</span>
<input class='form-control' type="text" id="inputldg_text" style="width:auto"/>
</span>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeInputModal('cancel');" translate>Cancel</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" onclick="closeInputModal('ok');" translate>Ok</button>
</span>
</div>
</div>
<!-- /input content -->
</div>
<!-- /input Modal -->

39
www/sub/macrodlg.html Normal file
View File

@@ -0,0 +1,39 @@
<!-- macro Modal -->
<div id="macrodlg.html" class="modal" onclick="clear_drop_menu(event)">
<!-- macro content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeMacroDialog()"><b>&times;</b></span>
<h3><div class="modal-title" translate>Macro Editor</div></h3>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr><th></th><th translate>Name</th><th translate>Icon</th><th translate>Color</th><th translate>Target</th><th translate>Filename</th></tr>
</thead>
<tbody id="dlg_macro_list">
</tbody>
</table>
</div>
<div class="modal-footer" >
<div class="pull-left" id="macrodlg_upload_msg">
<span translate>Saving</span>
&nbsp;
<progress name='prg' id='macrodlg_prg' max='100'></progress>
&nbsp;
<span id="macrodlg_upload_percent">0</span>%</td>
</div>
<span class="pull-right">
<button class="btn btn-warning" onclick="closeMacroDialog()" translate>Cancel</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" onclick="SaveNewMacroList()" translate>Save</button>
</span>
</div>
</div>
<!-- /macro content -->
</div>
<!-- /macro Modal -->

22
www/sub/restartdlg.html Normal file
View File

@@ -0,0 +1,22 @@
<!-- restart Modal -->
<div id="restartdlg.html" class="modal topmodal">
<!-- restart content -->
<div class="modal-content">
<div class="modal-header">
<h3><div class="modal-title" translate>Restarting ESP3D</div></h3>
</div>
<div class="modal-body">
<table>
<tr>
<td><progress id='prgrestart' max='100'></progress></td>
<td>&nbsp;</td>
<td><span id='restartmsg' translate>Restarting, please wait....</span></td>
</tr>
</table>
</div>
<div class="modal-footer">
</div>
</div>
<!-- /restart content -->
</div>
<!-- /restart Modal -->

48
www/sub/scanwifidlg.html Normal file
View File

@@ -0,0 +1,48 @@
<!-- scanwifi Modal -->
<div id="scanwifidlg.html" class="modal">
<!-- scanwifi content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title"><span translate>List of available Access Points</span></div></h3>
</div>
<div class="modal-body">
<center>
<span id="AP_scan_status" translate>Scanning</span>
<div class="loader hide_it" id="AP_scan_loader"></div>
<span class='hide_it' id="AP_scan_list">
<table class="table table-bordered table-striped" style="width:auto">
<thead>
<tr>
<th translate>SSID</th>
<th translate>Signal</th>
<th translate>Protected</th>
<th translate>Join</th>
</tr>
</thead>
<tbody id="AP_scan_data"></tbody>
</table>
</span>
</center>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeModal('cancel') " translate>Close</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" id="refresh_scanwifi_btn" onclick="refresh_scanwifi()" >
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z' />
</g>
</svg>
</button>
</span>
</div>
</div>
<!-- /scanwifi content -->
</div>
<!-- /scanwifi Modal -->

79
www/sub/settingstab.html Normal file
View File

@@ -0,0 +1,79 @@
<div id="settingstab" class="tabcontent">
<center>
<h2>
<span translate>ESP3D Settings</span>
</h2>
<table >
<tr>
<td style='padding:10px'>
<button type="button" class="btn btn-info" onclick="statusdlg();">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h700q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z' />
</g>
</svg>
</button>
</td><td style='padding:10px'>
<button type="button" class="btn btn-success" onclick="SPIFFSdlg('/');">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M200 800l-200 -400v600h200q0 41 29.5 70.5t70.5 29.5h300q42 0 71 -29.5t29 -70.5h500v-200h-1000zM1500 700l-300 -700h-1200l300 700h1200z' />
</g>
</svg>
</button>
</td><td style='padding:10px'>
<button type="button" class="btn btn-warning" onclick="updatedlg();">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -207t-85 -207t-205 -86.5h-128v250q0 21 -14.5 35.5t-35.5 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-250h-222q-80 0 -136 57.5t-56 136.5q0 69 43 122.5t108 67.5q-2 19 -2 37q0 100 49 185 t134 134t185 49zM525 500h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -244q-13 -16 -32 -16t-32 16l-223 244q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z' />
</g>
</svg>
</button>
</td><td style='padding:10px'>
<button type="button" id="settings_restart_btn" class="btn btn-danger" onclick="restart_esp();">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z' />
</g>
</svg>
</button>
</td><td style='padding:10px'>
<button type="button" id="settings_refresh_btn" class="btn btn-primary" onclick="refreshSettings(current_setting_filter);">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill="currentColor" d='M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z' />
</g>
</svg>
</button>
</td></tr></table>
<br>
<span id="settings_status"></span>
<hr>
<div class="loader hide_it" id="settings_loader"></div>
<div class="container hide_it" id="settings_list_content">
<span>
<div class="radio-inline">
<label>
<input type="radio" id="network_setting_filter" name="setting_filter" value="network" onclick="build_HTML_setting_list('network')">
<span translate>Network</span>
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" id="printer_setting_filter" name="setting_filter" value="network" onclick="build_HTML_setting_list('printer')">
<span translate >Printer</span>
</label>
</div>
</span>
<table class="table table-bordered table-striped table-hover" style="width:auto;">
<thead>
<tr>
<th translate>Label</th>
<th translate>Value</th>
</tr>
</thead>
<tbody id="settings_list_data"></tbody>
</table>
</div>
</center>
</div>

26
www/sub/setupdlg.html Normal file
View File

@@ -0,0 +1,26 @@
<!-- setup Modal -->
<div id="setupdlg.html" class="modal">
<!-- setup content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title" translate>ESP3D Filesystem</div></h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeModal('cancel') " translate>Close</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" id="refreshsetupbtn" onclick="refreshsetup() " translate>Refresh</button>
</span>
</div>
</div>
<!-- /setup content -->
</div>
<!-- /setup Modal -->

33
www/sub/statusdlg.html Normal file
View File

@@ -0,0 +1,33 @@
<!-- status Modal -->
<div id="statusdlg.html" class="modal">
<!-- status content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeModal('cancel')"><b>&times;</b></span>
<h3><div class="modal-title" translate>ESP3D Status</div></h3>
</div>
<div class="modal-body">
<span id="status_msg"></span>
<span class="modal-text"></span>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeModal('cancel');" translate>Close</button>
</span>
<span class="pull-right">
&nbsp;&nbsp;
</span>
<span class="pull-right">
<button class="btn btn-primary" id="refreshstatusbtn" onclick="refreshstatus();">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z' />
</g>
</svg>
</button>
</span>
</div>
</div>
<!-- /status content -->
</div>
<!-- /status Modal -->

View File

@@ -0,0 +1,126 @@
<div class="panel panel-default" style ="min-width:450px">
<div class="panel-heading">
<div class="row">
<div class="col-md-12">
<div class="pull-left" >
<span translate>Temperatures</span>
</div>
<div class="pull-right">
<div class="form-inline">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" id="autocheck_temperature" onclick="on_autocheck_temperature()"/>
<span translate>auto-check every:</span>
</label>
<input class='form-control' type="number" min="1" max="99" style="width:4em" id="tempInterval_check" onchange="onTempIntervalChange()">
<span translate>sec</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body panel-height-temp">
<table class="table">
<thead>
<tr>
<th translate>Name</th>
<th translate>Options</th>
<th translate nowrap>Value | Target</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-lg-3 col-md-3" translate>Heater T0</td>
<td class="col-lg-6">
<div class="form-inline">
<div class="form-group">
<button onclick="temperature_heatOff('T0')" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="0" max="999" id="heaterT0SelectedTemp" value=0 onkeyup="temperature_handleKeyUp(event, 'T0')">&deg;C&nbsp;&nbsp;
<button onclick="temperature_heatSet('T0')" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
<td class="col-lg-3"><span class="tempDisplay text-nowrap" id="heaterT0DisplayTemp"></span><span id="heaterT0TargetTemp_anime" class="loader-pulse pull-right hide_it" style="color:red"></span></td>
</tr>
<tr id="temperature_secondExtruder" class="hide_it">
<td translate>Heater T1</td>
<td>
<div class="form-inline">
<div class="form-group">
<button onclick="temperature_heatOff('T1')" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="0" max="999" id="heaterT1SelectedTemp" value=0 onkeyup="temperature_handleKeyUp(event, 'T1')">&deg;C&nbsp;&nbsp;
<button onclick="temperature_heatSet('T1')" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
<td><span class="tempDisplay text-nowrap" id="heaterT1DisplayTemp"></span><span id="heaterT1TargetTemp_anime" class="hide_it loader-pulse pull-right" style="color:red"></span></td>
</tr>
<tr>
<td translate>Bed</td>
<td>
<div class="form-inline">
<div class="form-group">
<button onclick="temperature_heatOff('bed')" class="btn btn-primary">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z' />
</g>
</svg>
</button>&nbsp;&nbsp;
<input class='form-control' type="number" style="width:5em" min="0" max="999" id="bedSelectedTemp" value=0 onkeyup="temperature_handleKeyUp(event, 'bed')">&deg;C&nbsp;&nbsp;
<button onclick="temperature_heatSet('bed')" class="btn btn-danger">
<svg width='1.3em' height='1.2em' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='currentColor' d='M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z' />
</g>
</svg>
</button>
</div>
</div>
</td>
<td><span class="tempDisplay text-nowrap" id="bedDisplayTemp"></span><span id="bedTargetTemp_anime" class="hide_it loader-pulse pull-right" style="color:red"></span></td>
</tr>
</tbody>
</table>
<table width='100%' id="temperatures_output" class="hide_it">
<tr>
<td>
<canvas id="extruderTempgraph" height="130" width="200"></canvas>
</td>
<td>
&nbsp;&nbsp;
</td>
<td>
<canvas id="bedTempgraph" height="130" width="200" ></canvas>
</td>
</tr>
</table>
</div>
</div>

29
www/sub/updatedlg.html Normal file
View File

@@ -0,0 +1,29 @@
<!-- update Modal -->
<div id="updatedlg.html" class="modal">
<!-- update content -->
<div class="modal-content">
<div class="modal-header">
<span class="close" onclick="closeUpdateDialog('cancel')"><b>&times;</b></span>
<h3><div class="modal-title" translate>ESP3D Update</div></h3>
</div>
<div class="modal-body">
<table>
<tr>
<td><input type="file" id="fw-select" name="myfiles[]" accept=".bin" onchange="checkupdatefile();" /></td>
<td>&nbsp;</td>
<td><button class="btn btn-primary" id="uploadfw-button" style='display:none;' onclick="UploadUpdatefile();" translate >Update</button></td>
<td><progress style='display:none;' name='prgfw' id='prgfw' max='100'></progress></td>
<td>&nbsp;</td>
<td><span id='updatemsg' style='display:none;' translate>Restarting, please wait....</span><span id='counter'></span></td>
</tr>
</table>
</div>
<div class="modal-footer">
<span class="pull-right">
<button class="btn btn-warning" onclick="closeUpdateDialog('cancel')" translate>Close</button>
</span>
</div>
</div>
<!-- /update content -->
</div>
<!-- /update Modal -->