92 Commits

Author SHA1 Message Date
80de4fcf5b Update TODO 2020-02-04 13:18:00 +01:00
2ef18dbb3d Update .travis.yml 2020-02-04 13:07:30 +01:00
be33f05d61 Update .travis.yml 2020-02-04 13:05:05 +01:00
8f1335bca9 Update .travis.yml 2020-02-04 13:00:09 +01:00
89d6b307ec fix Makefile 2019-12-19 22:39:48 +01:00
88e95e819a fix 2019-12-15 12:11:19 +01:00
e47a424a9f add server side api 2019-08-30 13:27:17 +02:00
9b75bc4ca2 enable sendmail in blogger 2019-06-13 11:06:38 +02:00
8a9941f6ed Merge branch 'master' of https://github.com/lxsang/antos 2019-06-11 18:33:30 +02:00
5db6901770 update Blogger 2019-06-11 18:33:14 +02:00
cd6d10910b extension for notepad 2019-05-03 13:18:51 +02:00
3e008c472b fix bug on the new firefox that fired menucontext and onclick at the sametime 2019-04-25 12:28:39 +02:00
10024d8613 Update README.md 2018-10-03 11:30:33 +02:00
028417b4f9 add type to PromptDialog 2018-10-01 18:40:45 +02:00
4552840440 GraphEditor move to antosdk-apps repository 2018-10-01 16:37:00 +02:00
eb4e52a31a Update README.md 2018-09-29 13:22:55 +02:00
fa15f3c3b4 fix notification application icon bug 2018-09-16 20:08:43 +02:00
4ce83df4bb minor fix 2018-09-14 19:29:13 +02:00
5b6e68116b fix bug 2018-09-13 21:41:14 +02:00
aec5457a31 fix bug and add afx-nspinner widget 2018-09-13 20:14:12 +02:00
7659438138 fix context menu bug on afx-apps-dock 2018-09-12 21:50:16 +02:00
205a3c0d5b Merge branch 'master' of https://github.com/lxsang/antos 2018-09-12 18:28:51 +02:00
b6100b2d07 change REST path on remote handle 2018-09-12 18:28:32 +02:00
e8cdeaedb6 Update README.md 2018-07-26 11:42:14 +02:00
8446f1874b Update README.md 2018-07-26 11:41:42 +02:00
4378723fff fix 2018-07-24 18:13:50 +02:00
46cec340e2 fix 2018-07-24 15:49:36 +02:00
b2db12e42f improvement & bug fix 2018-07-24 15:17:43 +02:00
3cad7be3bf fix 2018-04-14 17:31:42 +02:00
ab084d9e79 Blogger now support katex rendering 2018-04-12 23:16:22 +02:00
7a4ba008b0 generate locale files 2018-03-27 18:54:54 +02:00
59cde330da fix core api bugs 2018-03-27 18:47:27 +02:00
e72aaddf45 add tooltip support 2018-03-26 14:33:06 +02:00
5837fa742b add tooltip support 2018-03-26 14:26:34 +02:00
47bf528f89 add tooltip support 2018-03-26 14:22:23 +02:00
9f0986bc8d add tooltip support 2018-03-26 14:21:55 +02:00
d788f87ab9 fix setting save bug 2018-03-24 22:15:25 +01:00
57971e4338 fix core api bug 2018-03-24 00:21:53 +01:00
ca647d31c0 fix core api bug 2018-03-23 23:18:32 +01:00
c403a5b8bf merged Merge branch 'master' of https://github.com/lxsang/antos 2018-03-23 23:03:32 +01:00
035a7f3723 fix observable core 2018-03-23 23:03:17 +01:00
2438153c02 fix 2018-03-22 11:11:56 +01:00
af542f32c4 fix slider 2018-03-21 19:59:24 +01:00
3922f3764d fix stuff 2018-03-21 19:05:08 +01:00
278ee54b2e fix slider 2018-03-21 11:59:01 +01:00
da342ea574 Market now can update package to newer version 2018-03-21 11:21:33 +01:00
1b4f117060 add <afx-slider> 2018-03-21 00:21:04 +01:00
519209af0c add <afx-slider> 2018-03-21 00:18:18 +01:00
93622ec98a add <afx-slider> 2018-03-21 00:12:55 +01:00
0510da0701 fix 2018-03-20 15:19:32 +01:00
988993483f fix scheme load bug 2018-03-20 15:05:41 +01:00
857b2167c5 fix 2018-03-20 13:52:31 +01:00
f4f2e6f124 minor fix 2018-03-20 13:19:40 +01:00
f89c71e2b3 AntOSDK first working version, now application can be built from browser 2018-03-20 13:07:23 +01:00
09f72fd436 AntOSDK now can generate release zip of the application 2018-03-20 00:06:46 +01:00
0882a6a1f1 AntOSDK now can generate release zip of the application 2018-03-19 23:58:35 +01:00
1e4c134454 Build and run app directly from antOSDK 2018-03-19 19:21:45 +01:00
8643b819fd Build and run app directly from antOSDK 2018-03-19 19:13:28 +01:00
e8d4815e93 Build and run app directly from antOSDK 2018-03-19 19:11:38 +01:00
cd3bba7cf8 Update TODO 2018-03-19 12:07:12 +01:00
09ca30ad9a Update README.md 2018-03-19 11:26:53 +01:00
6fdf907868 Update README.md 2018-03-19 11:11:48 +01:00
b767e40db4 Update README.md 2018-03-19 11:11:36 +01:00
6be5672e43 Update .travis.yml 2018-03-19 11:08:25 +01:00
ceb704d862 Update .travis.yml 2018-03-19 11:04:05 +01:00
023b928bc7 Update .travis.yml 2018-03-19 11:02:09 +01:00
02a601b739 Update Makefile 2018-03-19 10:59:45 +01:00
8ae8251d0a Create .travis.yml 2018-03-19 10:55:09 +01:00
286fb256c8 add SDK application 2018-03-19 00:37:16 +01:00
129633844f add SDK application 2018-03-19 00:36:55 +01:00
b4428d0188 fix MarketPlace 2018-03-18 14:16:06 +01:00
4290ea602a minor fix 2018-03-17 23:46:37 +01:00
a111162e7b minor fix 2018-03-17 23:15:52 +01:00
5c5517e685 fix 2018-03-17 22:42:54 +01:00
6d8c17e8e7 minor fix 2018-03-17 21:54:03 +01:00
f548c241af add svg support to Preview 2018-03-17 21:49:50 +01:00
7133bdcbab fix graph editor 2018-03-17 20:50:51 +01:00
0ff98fee98 GraphEditor now support mermaid 2018-03-16 19:53:32 +01:00
2f57c05ef3 Blogger is no longer default application, it is move to app store 2018-03-16 12:57:44 +01:00
9deb575628 user uglifycss to compress css file 2018-03-15 22:36:38 +01:00
1450891943 merged
Merge branch 'master' of https://github.com/lxsang/antos
2018-03-15 11:00:47 +01:00
2221ea0bc4 add licence to source file 2018-03-15 11:00:24 +01:00
373f305848 Update README.md 2018-03-15 10:30:53 +01:00
43cbbf9e3d Update README.md 2018-03-15 10:30:33 +01:00
9dc4420ff2 Update README.md 2018-03-15 10:29:13 +01:00
bfedca3e3e Update LICENSE 2018-03-15 10:28:07 +01:00
7fa73561c4 Update README.md 2018-03-15 10:15:41 +01:00
df80cbd652 minor bug fix 2018-03-14 19:17:41 +01:00
f671966b96 fix appsByMime bug 2018-03-14 18:47:26 +01:00
1ff616786e fix marketplace uninstall bug 2018-03-13 19:41:46 +01:00
7878364f57 fix dot export 2018-03-13 19:23:12 +01:00
a0008663ab add DotEditor package 2018-03-13 18:05:33 +01:00
177 changed files with 21880 additions and 466 deletions

11
.travis.yml Normal file
View File

@ -0,0 +1,11 @@
language: javascript
node_js:
- 7
install:
- npm install -g coffeescript
- npm install -g uglify-es
- npm install -g uglifycss
- npm install -g riot-cli
script:
- make
- make release

687
LICENSE
View File

@ -1,21 +1,674 @@
MIT License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2018 Xuan Sang LE
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.
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:
Preamble
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
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.
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>.

View File

@ -1,9 +1,16 @@
BUILDDIR = build/htdocs/os
BUILDDIR?=build/htdocs/os
BLUE=\033[1;34m
NC=\033[0m
GSED=sed
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
GSED=gsed
endif
coffees= src/core/core.coffee\
src/core/api.coffee\
src/core/settings.coffee\
@ -22,12 +29,15 @@ coffees= src/core/core.coffee\
packages = CoreServices NotePad wTerm ActivityMonitor Files MarkOn MarketPlace Blogger Preview Setting
packages = CoreServices NotePad wTerm ActivityMonitor Files MarkOn MarketPlace Preview Setting
main: build_coffees build_tags build_themes schemes libs build_packages languages
main: initd build_coffees build_tags build_themes schemes libs build_packages languages
- cp src/index.html $(BUILDDIR)/
lite: build_coffee build_tag build_theme schemes build_packages
initd:
- mkdir -p $(BUILDDIR)
lite: build_coffees build_tags build_themes schemes build_packages
#%.js: %.coffee
# coffee --compile $<
@ -97,30 +107,39 @@ package:
cp -rf src/packages/$$PKG/build/* $(BUILDDIR)/packages/$$PKG/;\
test -d src/packages/$$PKG/build && rm -r src/packages/$$PKG/build;
pkgar:
read -r -p "Enter package name: " PKG;\
echo $$PKG | make package &&\
test -f $(BUILDDIR)/packages/$$PKG/main.js && uglifyjs $(BUILDDIR)/packages/$$PKG/main.js --compress --mangle --output $(BUILDDIR)/packages/$$PKG/main.js;\
test -f $(BUILDDIR)/packages/$$PKG/main.css && uglifycss --output $(BUILDDIR)/packages/$$PKG/main.css $(BUILDDIR)/packages/$$PKG/main.css;\
cd $(BUILDDIR)/packages/$$PKG && zip -r "$$PKG.zip" ./ ; \
cd ../../ && (test -d repo/$$PKG || mkdir repo/$$PKG) && mv packages/$$PKG/"$$PKG.zip" repo/$$PKG && touch repo/$$PKG/$$PKG.md && rm -r packages/$$PKG
uglify:
# uglify antos.js
# npm install uglify-es -g
# npm install uglify-js -g
uglifyjs $(BUILDDIR)/scripts/antos.js --compress --mangle --output $(BUILDDIR)/scripts/antos.js
# uglify tags
# npm install riot -g
# npm install riot-cli -g
riot --ext js $(BUILDDIR)/resources/antos_tags.js $(BUILDDIR)/resources/antos_tags.js
uglifyjs $(BUILDDIR)/resources/antos_tags.js --compress --mangle --output $(BUILDDIR)/resources/antos_tags.js
sed -i 's/resources\/antos_tags.js/scripts\/riot.min.js/g' $(BUILDDIR)/index.html
sed -i 's/scripts\/riot.compiler.min.js/resources\/antos_tags.js/g' $(BUILDDIR)/index.html
sed -i 's/type=\"riot\/tag\"//g' $(BUILDDIR)/index.html
# npm install minify -g
$(GSED) -i 's/resources\/antos_tags.js/scripts\/riot.min.js/g' $(BUILDDIR)/index.html
$(GSED) -i 's/scripts\/riot.compiler.min.js/resources\/antos_tags.js/g' $(BUILDDIR)/index.html
$(GSED) -i 's/type=\"riot\/tag\"/ /g' "$(BUILDDIR)/index.html"
# npm install uglifycss -g
# uglify the css
minify --output $(BUILDDIR)/resources/themes/antos/antos.css $(BUILDDIR)/resources/themes/antos/antos.css
minify --output $(BUILDDIR)/resources/themes/system/font-awesome.css $(BUILDDIR)/resources/themes/system/font-awesome.css
uglifycss --output $(BUILDDIR)/resources/themes/antos/antos.css $(BUILDDIR)/resources/themes/antos/antos.css
uglifycss --output $(BUILDDIR)/resources/themes/system/font-awesome.css $(BUILDDIR)/resources/themes/system/font-awesome.css
#uglify each packages
for d in $(packages); do\
echo "Uglifying $$d";\
test -f $(BUILDDIR)/packages/$$d/main.js && uglifyjs $(BUILDDIR)/packages/$$d/main.js --compress --mangle --output $(BUILDDIR)/packages/$$d/main.js;\
test -f $(BUILDDIR)/packages/$$d/main.css && minify --output $(BUILDDIR)/packages/$$d/main.css $(BUILDDIR)/packages/$$d/main.css;\
test -f $(BUILDDIR)/packages/$$d/main.css && uglifycss --output $(BUILDDIR)/packages/$$d/main.css $(BUILDDIR)/packages/$$d/main.css;\
done
release: main uglify
clean:
rm -rf $(BUILDDIR)/*
rm -rf $(BUILDDIR)/*

View File

@ -1,13 +1,19 @@
# antOS
Server or Embedded Linux are often headless, so accessing the resource on these systems is not always obvious. The aim of this project is to develop a client core API that provides a desktop like experience to remotely access resource on the server using web technologies. AntOS is based on jQuery and Riot, it is designed to be used along with our antd server and Lua based server side app, but can be adapted to be used with any server side languages (PHP, etc) and server, by implementing all the system calls API defined in core/handlers/RemoteHandler.coffee. Basically, application design for the web os relies on these system calls to communicating with the server. The API defines the core UI, system calls (to server), Virtual File system, virtual database and the necessary libraries for easing the development of webOS's applications. Applications can be developped with coffee/javascript/css without the need of a server side script.
[![Build Status](https://travis-ci.org/lxsang/antos.svg?branch=master)](https://travis-ci.org/lxsang/antos)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flxsang%2Fantos.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flxsang%2Fantos?ref=badge_shield)
Server or Embedded Linux are often headless, so accessing the resource on these systems is not always obvious. The aim of this project is to develop a client core API that enables desktop like experience to remote server's resource accessing using web technologies. AntOS is based on jQuery and Riot, it is designed to be used along with our [**antd**](https://github.com/lxsang/ant-http) server and Lua based server side app, but it can also be adapted to any server side languages (PHP, etc) and server, by implementing all the system calls API defined in core/handlers/RemoteHandler.coffee. Basically, application design for the web os relies on these system calls to communicating with the server. The API defines the core UI, system calls (to server), Virtual File system, virtual database and the necessary libraries for easing the development of webOS's applications. Applications can be developped with coffee/javascript/css without the need of a server side script.
Note that, the development of the project is in early alpha state, so bugs are very welcome :)
The WebOS is tested on recent Firefox, Chrome and Safari, however i did not test it on IE or Edge since i have no Windows device :)
## Demo
A demo of the webOS is available at my page [https://os.lxsang.me](https://os.lxsang.me) using username: demo and password: demo
A demo of the web desktop is available at my page [https://os.lxsang.me](https://os.lxsang.me) using username: demo and password: demo
![Screenshot](screenshot.png "Screenshot")
## AntOS applications
[https://github.com/lxsang/antosdk-apps](https://github.com/lxsang/antosdk-apps)
## Build
@ -24,10 +30,18 @@ It you have any problem, please contact me or open an issue, i'll try to respons
Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
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:
AnTOS is is licensed under the GNU General Public License v3.0, see the LICENCE file for more information
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
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.
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 <https://www.gnu.org/licenses/>.

5
TODO
View File

@ -1,3 +1,2 @@
# add version number
# bug tracking app
# packages manager (restricted mode)
# Remove riot dependecies
# Rewrite the UI system

View File

@ -1,7 +1,26 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
_GUI = self.OS.GUI
_API = self.OS.API
_PM = self.OS.PM
_OS = self.OS
_courrier = self.OS.courrier
this.onload = () ->
($ document).on 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', ()->
_GUI.fullscreen = not _GUI.fullscreen
self.OS.boot()

View File

@ -1,20 +1,37 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class BaseApplication extends this.OS.GUI.BaseModel
constructor: (name, args) ->
super name, args
_OS.setting.applications[@name] = {} if not _OS.setting.applications[@name]
if (not _OS.setting.applications[@name]) or (Array.isArray OS.setting.applications[@name])
_OS.setting.applications[@name] = {}
@setting = _OS.setting.applications[@name]
@keycomb =
ALT: {}
CTRL: {}
SHIFT: {}
META: {}
me = @
init: ->
me = @
@off "*"
@on "exit", () -> me.quit()
# first register some base event to the app
@subscribe "appregistry"
, ( m ) ->
me.applySetting m.data.m if (m.name is me.name)
@on "focus", () ->
me.sysdock.set "selectedApp", me
me.appmenu.pid = me.pid
@ -30,6 +47,10 @@ class BaseApplication extends this.OS.GUI.BaseModel
switch d.e.item.data.dataid
when "#{me.name}-about" then me.openDialog "AboutDialog", ()->
when "#{me.name}-exit" then me.trigger "exit"
@on "apptitlechange", () -> me.sysdock.update()
@loadScheme()
loadScheme: () ->
#now load the scheme
path = "#{@meta().path}/scheme.html"
@.render path
@ -49,6 +70,8 @@ class BaseApplication extends this.OS.GUI.BaseModel
return false
applySetting: (k) ->
applyAllSetting: () ->
@applySetting k for k, v of @setting
registry: (k, v) ->
@setting[k] = v
@publish "appregistry", k
@ -65,7 +88,10 @@ class BaseApplication extends this.OS.GUI.BaseModel
toggle: () ->
@trigger "toggle"
title: () ->
@scheme.get "apptitle"
onexit: (evt) ->
@cleanup(evt)
if not evt.prevent
@ -96,8 +122,7 @@ class BaseApplication extends this.OS.GUI.BaseModel
data:->
#implement by subclasses
# to return app data
update:->
#implement by subclasses
cleanup: (e) ->
#implement by subclasses
# to handle the exit event

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class SubWindow extends this.OS.GUI.BaseModel
constructor: (name) ->
super name, null
@ -54,12 +71,12 @@ class BasicDialog extends BaseDialog
init: () ->
@title = @name if not @title
html = "<afx-app-window data-id = 'dia-window' width='#{@conf.width}' height='#{@conf.height}'>
<afx-vbox>"
html += "<#{v.tag} #{v.att} style = 'margin-left:5px; margin-right:5px;' data-id = 'content#{k}'></#{v.tag}>" for k,v of @conf.tags
html = "<afx-app-window data-id = '#{@name}' width='#{@conf.width}' height='#{@conf.height}'>"
html += "<afx-hbox><div data-width='7'></div><afx-vbox><div data-height='5'></div>"
html += "<#{v.tag} #{v.att} data-id = 'content#{k}'></#{v.tag}>" for k,v of @conf.tags
html += "<div data-height = '35' style=' text-align:right;padding-top:3px;'>"
html += "<afx-button data-id = 'bt#{k}' text = '#{v.label}' style='margin-right:5px;'></afx-button>" for k,v of @conf.buttons
html += "</div><div data-height='5'></div></afx-vbox></afx-app-window>"
html += "<afx-button data-id = 'bt#{k}' text = '#{v.label}' style='margin-left:5px;'></afx-button>" for k,v of @conf.buttons
html += "</div><div data-height='5'></div></afx-vbox><div data-width='7'></div></afx-hbox></afx-app-window>"
#render the html
_GUI.htmlToScheme html, @, @host
@ -104,6 +121,7 @@ class PromptDialog extends BasicDialog
return unless d.data
(d.find "content0").set "text", d.data.label
(d.find "content1").value = d.data.value if d.data.value
$(d.find "content1").attr("type", d.data.type) if d.data.type
xtra: (d) ->
$( d.find "content1" ).keyup (e) ->
(d.find "bt0").trigger() if e.which is 13
@ -140,9 +158,9 @@ this.OS.register "CalendarDialog", CalendarDialog
class ColorPickerDialog extends BasicDialog
constructor: () ->
super "ColorPickerDialog", {
tags: [{ tag: 'afx-color-picker' }],
tags: [{ tag: 'afx-color-picker' }, {tag:'div', att: 'data-height="5"' }],
width: 313,
height: 220,
height: 250,
resizable: false,
buttons: [
{
@ -183,7 +201,7 @@ this.OS.register "InfoDialog", InfoDialog
class YesNoDialog extends BasicDialog
constructor: () ->
super "YesNoDialog", {
tags: [{ tag: "afx-label", att: "style = 'padding-left:10px;'" }],
tags: [{ tag: "afx-label" }],
width: 300,
height: 100,
resizable: true,
@ -273,31 +291,40 @@ class FileDiaLog extends BaseDialog
e.child.path.asFileHandler().read (d) ->
return me.error __("Resource not found: {0}", e.child.path) if d.error
f d.result
location.set "onlistselect", (e) ->
return unless e and e.data.path
e.data.path.asFileHandler().read (d) ->
setroot = (path) ->
path.asFileHandler().read (d) ->
if(d.error)
return me.error __("Resource not found: {0}", e.data.path)
fileview.set "path", e.data.path
return me.error __("Resource not found: {0}", path)
fileview.set "path", path
fileview.set "data", d.result
location.set "items", ( i for i in @systemsetting.VFS.mountpoints when i.type isnt "app" )
location.set "selected", 0 unless location.get "selected"
if not @data or not @data.root
location.set "onlistselect", (e) ->
return unless e and e.data.path
setroot e.data.path
location.set "items", ( i for i in @systemsetting.VFS.mountpoints when i.type isnt "app" )
location.set "selected", 0 unless location.get "selected"
else
$(location).hide()
@trigger "calibrate"
setroot @data.root
fileview.set "onfileselect", (f) ->
($ filename).val f.filename if f.type is "file"
(@find "bt-ok").set "onbtclick", (e) ->
f = fileview.get "selectedFile"
return me.notify __("Please select a file") unless f
return me.notify __("Please select a file/fofler") unless f
return me.notify __("Please select {0} only", me.data.type) if me.data and me.data.type and me.data.type isnt f.type
if me.data and me.data.mimes
#verify the mime
m = false
for v in me.data.mimes
if f.mime.match (new RegExp v, "g")
m = true
break
if f.mime
for v in me.data.mimes
if f.mime.match (new RegExp v, "g")
m = true
break
return me.notify __("Only {0} could be selected", me.data.mimes.join(",")) unless m
d = f.path
d = f.path.asFileHandler().parent() if f.type is "file"
me.handler d, ($ filename).val(), f.path if me.handler
me.handler d, ($ filename).val(), f.path, f if me.handler
#sel = if me.data and me.data.selection then me.data.selection else "file"
#me.handler f, ($ filename).val() if me.handler and ((f.type is sel) or (sel is "*"))
me.quit()

View File

@ -1,7 +1,24 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class BaseEvent
constructor: (@name) ->
constructor: (@name, @force) ->
@prevent = false
preventDefault:()->
@prevent = true
preventDefault: () ->
@prevent = true if not @force
this.OS.GUI.BaseEvent = BaseEvent

View File

@ -1,3 +1,21 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class BaseModel
constructor: (@name, @args) ->
me = @
@ -9,15 +27,14 @@ class BaseModel
@on "exit", () -> me.quit()
@host = "#desktop"
@dialog = undefined
@subscribe "systemlocalechange", (name) ->
me.scheme.update() if me.scheme
render: (p) ->
_GUI.loadScheme p, @, @host
quit: () ->
evt = new _GUI.BaseEvent("exit")
quit: (force) ->
evt = new _GUI.BaseEvent("exit", force)
@onexit(evt)
if not evt.prevent
@observable.off "*"
delete @.observable
@dialog.quit() if @dialog
_PM.kill @
@ -26,7 +43,15 @@ class BaseModel
mt = @meta()
return mt.path if mt and mt.path
return null
# call a server side script
call: (cmd, func) ->
@_api.apigateway cmd, false, func
# get a stream
stream: () ->
return @_api.apigateway null, true, null
init: ->
#implement by sub class
onexit: (e) ->
@ -34,7 +59,9 @@ class BaseModel
one: (e, f) -> @observable.one e, f
on: (e, f) -> @observable.on e, f
off: (e, f) ->
return @observable.off e unless f
@observable.off e, f
trigger: (e, d) -> @observable.trigger e, d
subscribe: (e, f) ->
@ -59,9 +86,16 @@ class BaseModel
@dialog.title = title
@dialog.init()
publish: (t, m) ->
ask: (t, m, f) ->
@._gui.openDialog "YesNoDialog", (d) ->
f() if d
, t, { text: m }
publish: (t, m, e) ->
mt = @meta()
_courrier.trigger t, { id: @pid, name: @name, data: { m: m, icon: mt.icon, iconclass: mt.iconclass } }
icon = undefined
icon = "#{mt.path}/#{mt.icon}" if mt.icon
_courrier.trigger t, { id: @pid, name: @name, data: { m: m, icon: icon, iconclass: mt.iconclass }, error: e }
notify: (m) ->
@publish "notification", m
@ -70,7 +104,7 @@ class BaseModel
@publish "warning", m
error: (m) ->
@publish "error", m + (@_api.throwe @name)
@publish "error", m, (@_api.throwe @name)
fail: (m) ->
@publish "fail", m
@ -78,6 +112,9 @@ class BaseModel
throwe: () ->
@_api.throwe @name
update:->
@scheme.update() if @scheme
find: (id) -> ($ "[data-id='#{id}']", @scheme)[0] if @scheme
select: (sel) -> $ sel, @scheme if @scheme

View File

@ -1,3 +1,21 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class BaseService extends this.OS.GUI.BaseModel
constructor: (name, args) ->
super name, args
@ -16,7 +34,9 @@ class BaseService extends this.OS.GUI.BaseModel
attach: (h) ->
@holder = h
update: () -> @holder.update() if @holder
update: () ->
@holder.update() if @holder
@scheme.update() if @scheme
watch: ( t, f) ->
me = @

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class FormatedString
constructor: (@fs, args) ->
@values = []
@ -8,7 +25,7 @@ class FormatedString
__: () ->
me = @
return @fs.l().replace /{(\d+)}/g, (match, number) ->
return if typeof me.values[number] != 'undefined' then me.values[number] else match
return if typeof me.values[number] != 'undefined' then me.values[number].__() else match
hash: () ->
@__().hash()
@ -25,6 +42,46 @@ class FormatedString
args = arguments
@values[i] = args[i] for i in [0..args.length - 1]
class Version
constructor:(@string) ->
arr = @string.split "-"
br =
"r": 3,
"b": 2,
"a": 1
@branch = 3
@branch = br[arr[1]] if arr.length is 2 and br[arr[1]]
mt = arr[0].match /\d+/g
throw new Error __("Version string is in invalid format: {0}", @string) if not mt
@major = 0
@minor = 0
@patch = 0
@major = Number mt[0] if mt.length >= 1
@minor = Number mt[1] if mt.length >= 2
@patch = Number mt[2] if mt.length >= 3
# this function return
# 0 if the version is unchanged
# 1 if the current version is newer
# -1 if the current version is older
compare: (o) ->
other = o.__v()
return 1 if @branch > other.branch
return -1 if @branch < other.branch
return 0 if @major is other.major and @minor is other.minor and @patch is other.patch
return 1 if @major > other.major
return -1 if @major < other.major
return 1 if @minor > other.minor
return -1 if @minor < other.minor
return 1 if @patch > other.patch
return -1
nt: (o) ->
return (@compare o) is 1
ot: (o) ->
return (@compare o) is -1
__v: () -> @
toString: () -> @string
Object.defineProperty Object.prototype, '__',
value: () ->
return @toString()
@ -36,7 +93,8 @@ String.prototype.hash = () ->
i = this.length
hash = (hash * 33) ^ this.charCodeAt(--i) while i
hash >>> 0
String.prototype.__v = () ->
return new Version @
String.prototype.asBase64 = () ->
tmp = encodeURIComponent this
return btoa ( tmp.replace /%([0-9A-F]{2})/g, (match, p1) ->
@ -63,7 +121,7 @@ if not String.prototype.format
String.prototype.format = () ->
args = arguments
return @replace /{(\d+)}/g, (match, number) ->
return if typeof args[number] != 'undefined' then args[number] else match
return if typeof args[number] != 'undefined' then args[number].__() else match
String.prototype.f = () ->
args = arguments
@ -259,6 +317,7 @@ self.OS.API =
f() if f
else
console.log l, "Library exist, no need to load"
f() if f
_courrier.trigger "sharedlibraryloaded", l
requires:(libs, f) ->
@ -278,6 +337,8 @@ self.OS.API =
}, f
setting: (f) ->
_API.handler.setting f
apigateway: (d, ws, c) ->
return _API.handler.apigateway d, ws, c
search: (text) ->
r = []

View File

@ -1,3 +1,21 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
'use strict'
#define the OS object
self = this
@ -16,7 +34,7 @@ self.OS or=
courrier:
observable: riot.observable()
quota: 0
listeners: new Object
listeners: {}
on: (e, f, a) ->
_courrier.listeners[a.pid] = [] unless _courrier.listeners[a.pid]
_courrier.listeners[a.pid].push { e: e, f: f }
@ -34,7 +52,7 @@ self.OS or=
return unless _courrier.listeners[app.pid] and _courrier.listeners[app.pid].length > 0
_courrier.observable.off i.e, i.f for i in _courrier.listeners[app.pid]
delete _courrier.listeners[app.pid]
_courrier.listeners[app.pid] = []
# _courrier.listeners[app.pid]
getMID: () ->
_courrier.quota += 1
_courrier.quota
@ -85,14 +103,17 @@ self.OS or=
delete _PM.processes[app.name][i]
_PM.processes[app.name].splice i, 1
killAll: (app) ->
killAll: (app, force) ->
return unless _PM.processes[app]
tmp = []
tmp.push a for a in _PM.processes[app]
a.quit() for a in tmp
a.quit(force) for a in _PM.processes[app]
cleanup: ->
console.log "Clean up system"
_PM.killAll a, true for a, v of _PM.processes
_courrier.observable.off("*") if _courrier.observable
$(window).off('keydown')
($ "#workspace").off("mouseover")
delete _courrier.observable
($ "#wrapper").empty()
_GUI.clearTheme()
_courrier.observable = riot.observable()
@ -125,6 +146,7 @@ self.OS or=
#do clean up first
f() for n, f of _OS.cleanupHandlers
_API.handler.setting (r) ->
_OS.cleanup()
_API.handler.logout()
onexit: (n, f) ->
self.OS.cleanupHandlers[n] = f unless self.OS.cleanupHandlers[n]

View File

@ -1,3 +1,21 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class DB
constructor: (@table) ->

View File

@ -1,3 +1,21 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
self.OS.GUI =
subwindows: new Object()
dialog: undefined
@ -9,19 +27,32 @@ self.OS.GUI =
META: {}
SYS_MENU: [
{
text: "__(Applications)",
child: [],
dataid: "sys-apps"
iconclass: "fa fa-adn",
text: "",
iconclass: "fa fa-eercast",
dataid: "sys-menu-root",
child: [
{
text: "__(Applications)",
child: [],
dataid: "sys-apps"
iconclass: "fa fa-adn",
onmenuselect: (d) ->
_GUI.launch d.item.data.app
}
],
onmenuselect: (d) ->
_GUI.launch d.item.data.app
return _OS.exit() if d.item.data.dataid is "sys-logout"
return _GUI.toggleFullscreen() if d.item.data.dataid is "os-fullsize"
_GUI.launch d.item.data.app unless d.item.data.dataid
}
]
htmlToScheme: (html, app, parent) ->
scheme = $.parseHTML html
$(app.scheme).remove() if app.scheme
($ parent).append scheme
riot.mount ($ scheme), { observable: app.observable }
app.scheme = scheme[0]
riot.mount ($ scheme), { observable: app.observable }
app.main()
app.show()
loadScheme: (path, app, parent) ->
@ -84,6 +115,7 @@ self.OS.GUI =
try
arr.filter (m, i) ->
if mime.match (new RegExp m, "g")
return false if (apps.indexOf metas[idx]) >= 0
apps.push metas[idx]
return false
return false
@ -111,12 +143,15 @@ self.OS.GUI =
, __("Open with"), list
forceLaunch: (app, args) ->
console.log "This method is used for developing only, please use the launch method instead"
_PM.killAll app
($ _OS.APP[app].style).remove() if _OS.APP[app] and _OS.APP[app].style
_OS.APP[app] = undefined
console.warn "This method is used for developing only, please use the launch method instead"
_GUI.unloadApp app
_GUI.launch app, args
unloadApp: (app) ->
_PM.killAll app, true
($ _OS.APP[app].style).remove() if _OS.APP[app] and _OS.APP[app].style
delete _OS.APP[app]
loadApp: (app, ok, err) ->
path = "os://packages/#{app}"
path = _OS.setting.system.packages[app].path if _OS.setting.system.packages[app].path
@ -131,7 +166,8 @@ self.OS.GUI =
#load css file
css = "#{path}/main.css"
css.asFileHandler().onready (d) ->
el = $ '<link>', { rel: 'stylesheet', type: 'text/css', 'href': "#{_API.handler.get}/#{css}" }
stamp = (new Date).timestamp()
el = $ '<link>', { rel: 'stylesheet', type: 'text/css', 'href': "#{_API.handler.get}/#{css}?stamp=#{stamp}" }
.appendTo 'head'
_OS.APP[app].style = el[0] if _OS.APP[app]
ok app
@ -152,6 +188,7 @@ self.OS.GUI =
# now launch it
if _OS.APP[app]
_PM.createProcess app, _OS.APP[app], args
dock: (app, meta) ->
# dock an application to a dock
# create a data object
@ -166,11 +203,14 @@ self.OS.GUI =
# so that it can be themed
data.iconclass = "fa fa-cogs" if (not meta.icon) and (not meta.iconclass)
dock = $ "#sysdock"
app.init()
app.one "rendered", () ->
dock.get(0).newapp data
app.sysdock = dock.get(0)
app.appmenu = ($ "[data-id = 'appmenu']", "#syspanel")[0]
app.init()
app.subscribe "systemlocalechange", (name) -> app.update()
app.subscribe "appregistry", ( m ) ->
app.applySetting m.data.m if (m.name is app.name)
toggleFullscreen: () ->
el = ($ "body")[0]
@ -191,6 +231,7 @@ self.OS.GUI =
attachservice: (srv) ->
($ "#syspanel")[0].attachservice srv
srv.init()
srv.subscribe "systemlocalechange", (name) -> srv.update()
detachservice: (srv) ->
($ "#syspanel")[0].detachservice srv
bindContextMenu: (event) ->
@ -219,9 +260,33 @@ self.OS.GUI =
.css("background-size", wp.size)
.css("background-repeat", wp.repeat)
showTooltip: (el, text, e) ->
el = el[0]
label = ($ "#systooltip")[0]
$("#workspace").on "mousemove", (ev) ->
if $(ev.target).closest(el).length is 0
$(label).hide()
$("#workspace").off "mousemove"
arr = text.split /:(.+)/
tip = text
tip = arr[1] if arr.length > 1
offset = $(el).offset()
w = $(el).width()
h = $(el).height()
label.set "text", tip
$(label).show()
switch arr[0]
when "cr" # center right of the element
left = offset.left + w + 5
top = offset.top + h / 2 - $(label).height() / 2
$(label).css "top", top + "px"
.css "left", left + "px"
else
return unless e
$(label).css "top", e.clientY + 5 + "px"
.css "left", e.clientX + 5 + "px"
initDM: ->
($ document).on 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', ()->
_GUI.fullscreen = not _GUI.fullscreen
# check login first
_API.resource "schemes/dm.html", (x) ->
return null unless x
@ -254,11 +319,16 @@ self.OS.GUI =
event.preventDefault()
# system menu and dock
riot.mount ($ "#syspanel", $ "#wrapper")
riot.mount ($ "#sysdock", $ "#wrapper"), { items: [] }
riot.mount ($ "#sysdock", $ "#workspace"), { items: [] }
riot.mount ($ "#systooltip", $ "#wrapper")
# context menu
riot.mount ($ "#contextmenu")
riot.mount ($ "#contextmenu", $ "#wrapper")
($ "#workspace").contextmenu (e) -> _GUI.bindContextMenu e
# tooltip
($ "#workspace").mouseover (e) ->
el = $(e.target).closest "[tooltip]"
return unless el.length > 0
_GUI.showTooltip el, ($(el).attr "tooltip"), e
# desktop default file manager
desktop = $ "#desktop"
@ -344,31 +414,23 @@ self.OS.GUI =
console.log s, e
refreshDesktop: () ->
($ "#desktop")[0].fetch()
refreshSystemMenu: () ->
_GUI.SYS_MENU.length = 1
_GUI.SYS_MENU[0].child.length = 0
_GUI.SYS_MENU[0].child.push v for k, v of _OS.setting.system.packages when (v and v.app)
_GUI.SYS_MENU.push v for k, v of _OS.setting.system.menu
_GUI.SYS_MENU.push
_GUI.SYS_MENU[0].child.length = 1
_GUI.SYS_MENU[0].child[0].child.length = 0
_GUI.SYS_MENU[0].child[0].child.push v for k, v of _OS.setting.system.packages when (v and v.app)
_GUI.SYS_MENU[0].child.push v for k, v of _OS.setting.system.menu
_GUI.SYS_MENU[0].child.push
text: "__(Toggle Full screen)",
dataid: "os-fullsize",
iconclass: "fa fa-tv"
_GUI.SYS_MENU.push
_GUI.SYS_MENU[0].child.push
text: "__(Log out)",
dataid: "sys-logout",
iconclass: "fa fa-user-times"
($ "[data-id = 'os_menu']", "#syspanel")[0].update()
buildSystemMenu: () ->
menu =
text: ""
iconclass: "fa fa-eercast"
dataid: "sys-menu-root"
child: _GUI.SYS_MENU
menu.onmenuselect = (d) ->
return _OS.exit() if d.item.data.dataid is "sys-logout"
return _GUI.toggleFullscreen() if d.item.data.dataid is "os-fullsize"
_GUI.launch d.item.data.app unless d.item.data.dataid
menu = [menu]
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", menu
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", _GUI.SYS_MENU
#console.log menu
@ -376,7 +438,6 @@ self.OS.GUI =
return new _GUI.BasicDialog conf.name, conf.layout
login: () ->
_OS.cleanup()
_API.resource "schemes/login.html", (x) ->
return null unless x
scheme = $.parseHTML x

View File

@ -1,48 +1,66 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
self.OS.API.HOST = self.location.hostname+ (if self.location.port then":#{self.location.port}" else "")
self.OS.API.REST = "#{self.location.protocol}//#{self.OS.API.HOST}/lua-api/os"
self.OS.API.REST = "#{self.location.protocol}//#{self.OS.API.HOST}"
_REST = self.OS.API.REST
_HOST = self.OS.API.HOST
self.OS.API.handler =
# get file, require authentification
get: "#{_REST}/fs/get"
get: "#{_REST}/VFS/get"
# get shared file with publish
shared: "#{_REST}/fs/shared"
shared: "#{_REST}/VFS/shared"
scandir: (p, c ) ->
path = "#{_REST}/fs/scandir"
path = "#{_REST}/VFS/scandir"
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail __("Fail to scan directory: {0}", p), e, s
mkdir: (p, c ) ->
path = "#{_REST}/fs/mkdir"
path = "#{_REST}/VFS/mkdir"
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail __("Fail to create directory: {0}", p), e, s
sharefile: (p, pub , c) ->
path = "#{_REST}/fs/publish"
path = "#{_REST}/VFS/publish"
_API.post path, { path: p , publish: pub }, c, (e, s) ->
_courrier.osfail __("Fail to publish file: {0}", p), e, s
fileinfo: (p, c) ->
path = "#{_REST}/fs/fileinfo"
path = "#{_REST}/VFS/fileinfo"
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail __("Fail to get file meta data: {0}", p), e, s
readfile: (p, c, t) ->
path = "#{_REST}/fs/get/"
path = "#{_REST}/VFS/get/"
_API.get path + p, c, (e, s) ->
_courrier.osfail __("Fail to read file: {0}", p), e, s
, t
move: (s, d, c) ->
path = "#{_REST}/fs/move"
path = "#{_REST}/VFS/move"
_API.post path, { src: s, dest: d }, c, (e, s) ->
_courrier.osfail __("Fail to move file: {0} -> {1}", s, d), e, s
delete: (p , c) ->
path = "#{_REST}/fs/delete"
path = "#{_REST}/VFS/delete"
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail __("Fail to delete: {0}", p), e, s
fileblob: (p, c) ->
path = "#{_REST}/fs/get/"
path = "#{_REST}/VFS/get/"
_API.blob path + p, c, (e, s) ->
_courrier.osfail "Fail to read file: #{p}", e, s
@ -52,28 +70,41 @@ self.OS.API.handler =
_courrier.osfail __("Fail to {0} package", d.command), e, s
upload: (d, c) ->
path = "#{_REST}/fs/upload"
path = "#{_REST}/VFS/upload"
_API.upload path, d, c, (e, s) ->
_courrier.osfail __("Fail to upload file to: {0}", d), e, s
write: (p, d , c) ->
path = "#{_REST}/fs/write"
path = "#{_REST}/VFS/write"
_API.post path, { path: p, data: d }, c, (e, s) ->
_courrier.osfail __("Fail to write to file: {0}", p), e, s
scanapp: (p, c ) ->
path = "#{_REST}/system/application"
apigateway: (d, ws, c) ->
if ws
path = "#{_HOST}/system/apigateway?ws=1"
proto = if window.location.protocol is "https:" then "wss://" else "ws://"
socket = new WebSocket proto + path
if c then c(socket)
return socket
else
path = "#{_REST}/system/apigateway?ws=0"
_API.post path, d, c, (e, s) ->
_courrier.osfail __("Fail to invoke gateway api"), e, s
auth: (c) ->
p = "#{_REST}/system/auth"
p = "#{_REST}/user/auth"
_API.post p, {}, c, (e, s) ->
console.log e, s
alert __("Resource not found: {0}", p)
login: (d, c) ->
p = "#{_REST}/system/login"
p = "#{_REST}/user/login"
_API.post p, d, c, () ->
alert __("Resource not found: {0}", p)
logout: () ->
p = "#{_REST}/system/logout"
p = "#{_REST}/user/logout"
_API.post p, {}, (d) ->
_OS.boot()
, () ->
@ -89,6 +120,6 @@ self.OS.API.handler =
f({ error: m }) if f
dbquery: (cmd, d, c) ->
path = "#{_REST}/db/#{cmd}"
path = "#{_REST}/VDB/#{cmd}"
_API.post path, d, c, (e, s) ->
_courrier.osfail __("Fail to query data from database: {0}", path), e, s

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
self.OS.API.handler =
scandir: (p, c ) ->
path = 'resources/jsons/scandir.json'

View File

@ -245,4 +245,63 @@
"Theme":"Thème",
"VFS":"VFS",
"Wallpaper":"Fond d'écran"
,
"add {0} to zip":"add {0} to zip",
"Add files to build target":"Add files to build target",
"and unsaved project":"and unsaved project",
"Build and Run":"Build and Run",
"Build":"Build",
"Build done":"Build done",
"Build Options":"Build Options",
"Build release":"Build release",
"Cannot create file: {0}":"Cannot create file: {0}",
"Cannot export: {0}":"Cannot export: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot save project: {0}":"Cannot save project: {0}",
"Cannot save the zip file {0} : {1}":"Cannot save the zip file {0} : {1}",
"Coffees":"Coffees",
"Compiled successful":"Compiled successful",
"Copied {0} -> {1}":"Copied {0} -> {1}",
"Copied files":"Copied files",
"Created directory: {0}":"Created directory: {0}",
"Created file: {0}":"Created file: {0}",
"Css":"Css",
"Error when create directory: {0}":"Error when create directory: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Generated {0}":"Generated {0}",
"Graph editor":"Graph editor",
"Hide":"Hide",
"Ignore: {0} unsaved files {1}?":"Ignore: {0} unsaved files {1}?",
"Ignore unsaved project ?":"Ignore unsaved project ?",
"Installing...":"Installing...",
"Javascripts":"Javascripts",
"Metadata found...":"Metadata found...",
"New Project at":"New Project at",
"New project":"New project",
"Opening {0}":"Opening {0}",
"Open project":"Open project",
"Open Project":"Open Project",
"Output":"Output",
"Please select {0} only":"Please select {0} only",
"Please select a file/fofler":"Please select a file/fofler",
"Preparing for release":"Preparing for release",
"ProjectName":"ProjectName",
"Project":"Project",
"project saved":"project saved",
"Render":"Render",
"Running {0}...":"Running {0}...",
"Select a file":"Select a file",
"Show":"Show",
"Syntax error: {0}":"Syntax error: {0}",
"Uninstall: {0}?":"Uninstall: {0}?",
"Unsaved project":"Unsaved project",
"Update":"Update",
"Verifying {0}":"Verifying {0}",
"Version string is in invalid format: {0}":"Version string is in invalid format: {0}",
"Welcome to AntOSDK":"Welcome to AntOSDK",
"Your application version is older ({0} < {1})":"Your application version is older ({0} < {1})",
"zip file generated in release folder":"zip file generated in release folder"
}

View File

@ -1,219 +1,248 @@
{
"About":"About",
"About: {0}":"About: {0}",
"Add category":"Add category",
"Add repository":"Add repository",
"Address":"Address",
"Alive (ms)":"Alive (ms)",
"Application installed":"Application installed",
"Application {0} is not executable":"Application {0} is not executable",
"About":"À propos de",
"About: {0}":"À propos de: {0}",
"Add category":"Ajouter une catégorie",
"Add repository":"Ajouter un dépôt",
"Address":"Adresse",
"Alive (ms)":"Actif (ms)",
"Application installed":"Application installée",
"Application {0} is not executable":"L'application {0} n'est pas exécutable",
"Application":"Application",
"Applications":"Applications",
"Authentication":"Authentication",
"Cancel":"Cancel",
"Cannot Edit category":"Cannot Edit category",
"Cannot add new category":"Cannot add new category",
"Cannot create {0}":"Cannot create {0}",
"Cannot delete all content of: {0} [{1}]":"Cannot delete all content of: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Cannot delete the category: {0} [{1}]",
"Cannot delete the section: {0}":"Cannot delete the section: {0}",
"Cannot delete: {0}":"Cannot delete: {0}",
"Cannot down load the app {0}":"Cannot down load the app {0}",
"Cannot export file for embedding to text":"Cannot export file for embedding to text",
"Cannot fetch CV categories":"Cannot fetch CV categories",
"Cannot fetch the entry content":"Cannot fetch the entry content",
"Cannot fetch user data":"Cannot fetch user data",
"Cannot install {0}":"Cannot install {0}",
"Cannot load 3rd library at: {0}":"Cannot load 3rd library at: {0}",
"Cannot move section":"Cannot move section",
"Cannot read service script: {0}":"Cannot read service script: {0}",
"Cannot render the PDF file":"Cannot render the PDF file",
"Cannot save blog: {0}":"Cannot save blog: {0}",
"Cannot save section: {0}":"Cannot save section: {0}",
"Cannot save system setting":"Cannot save system setting",
"Cannot save user data":"Cannot save user data",
"Cannot share file: {0}":"Cannot share file: {0}",
"Cannot uninstall package: {0}":"Cannot uninstall package: {0}",
"Categories":"Categories",
"Clear all":"Clear all",
"Close tab":"Close tab",
"Close without saving ?":"Close without saving ?",
"Close":"Close",
"Copy not yet implemented":"Copy not yet implemented",
"Copy":"Copy",
"Created: {0}":"Created: {0}",
"Cut":"Cut",
"Delete a post":"Delete a post",
"Delete category":"Delete category",
"Delete section":"Delete section",
"Delete":"Delete",
"Desktop":"Desktop",
"Dialog {0} not found":"Dialog {0} not found",
"Do you really want to delete this post ?":"Do you really want to delete this post ?",
"Do you really want to delete: {0}?":"Do you really want to delete: {0}?",
"Download":"Download",
"Edit category":"Edit category",
"Edit repository":"Edit repository",
"Edit":"Edit",
"Authentication":"Authentification",
"Cancel":"Annuler",
"Cannot Edit category":"Impossible d'éditer la catégorie",
"Cannot add new category":"Impossible d'ajouter une nouvelle catégorie",
"Cannot create {0}":"Impossible de créer {0}",
"Cannot delete all content of: {0} [{1}]":"Impossible de supprimer tout le contenu de: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Impossible de supprimer la catégorie: {0} [{1}]",
"Cannot delete the section: {0}":"Impossible de supprimer la section: {0}",
"Cannot delete: {0}":"Impossible de supprimer: {0}",
"Cannot down load the app {0}":"Impossible de télécharger l'application {0}",
"Cannot export file for embedding to text":"Impossible d'exporter le fichier pour l'intégrer au texte",
"Cannot fetch CV categories":"Impossible d'extraire les catégories de CV",
"Cannot fetch the entry content":"Impossible d'extraire le contenu",
"Cannot fetch user data":"Impossible d'extraire les données utilisateur",
"Cannot install {0}":"Impossible d'installer {0}",
"Cannot load 3rd library at: {0}":"Impossible de charger la bibliothèque à: {0}",
"Cannot move section":"Impossible de déplacer la section",
"Cannot read service script: {0}":"Impossible de lire le script de service: {0}",
"Cannot render the PDF file":"Impossible de rendre le fichier PDF",
"Cannot save blog: {0}":"Impossible d'enregistrer le blog: {0}",
"Cannot save section: {0}":"Impossible d'enregistrer la section: {0}",
"Cannot save system setting":"Impossible d'enregistrer les paramètres du système",
"Cannot save user data":"Impossible d'enregistrer les données utilisateur",
"Cannot share file: {0}":"Impossible de partager le fichier: {0}",
"Cannot uninstall package: {0}":"Impossible de désinstaller le package: {0}",
"Categories":"Catégories",
"Clear all":"Tout effacer",
"Close tab":"Fermer l'onglet",
"Close without saving ?":"Fermer sans enregistrer?",
"Close":"Fermer",
"Copy not yet implemented":"Copie non encore implémentée",
"Copy":"Copier",
"Created: {0}":"Créé: {0}",
"Cut":"Couper",
"Delete a post":"Supprimer le text",
"Delete category":"Supprimer la catégorie",
"Delete section":"Supprimer la section",
"Delete":"Supprimer",
"Desktop":"Bureau",
"Dialog {0} not found":"La boîte de dialogue {0} n'a pas été trouvée",
"Do you really want to delete this post ?":"Voulez-vous vraiment supprimer ce texte ?",
"Do you really want to delete: {0}?":"Voulez-vous vraiment supprimer: {0}?",
"Download":"Télécharger",
"Edit category":"Modifier la catégorie",
"Edit repository":"Modifier le dépôt",
"Edit":"Modifier",
"Email":"Email",
"Error find app by mimes {0}":"Error find app by mimes {0}",
"Error reading package meta data: {0}":"Error reading package meta data: {0}",
"Error saving file {0}":"Error saving file {0}",
"Exit":"Exit",
"Fail to create directory: {0}":"Fail to create directory: {0}",
"Fail to create {0}: {1}":"Fail to create {0}: {1}",
"Fail to delete {0}: {1}":"Fail to delete {0}: {1}",
"Fail to delete: {0}":"Fail to delete: {0}",
"Fail to fetch packages list from: {0}":"Fail to fetch packages list from: {0}",
"Fail to get file meta data: {0}":"Fail to get file meta data: {0}",
"Fail to make request: {0}":"Fail to make request: {0}",
"Fail to move file: {0} -> {1}":"Fail to move file: {0} -> {1}",
"Fail to paste: {0}":"Fail to paste: {0}",
"Fail to publish file: {0}":"Fail to publish file: {0}",
"Fail to query data from database: {0}":"Fail to query data from database: {0}",
"Fail to read file: {0}":"Fail to read file: {0}",
"Fail to rename to {0}: {1}":"Fail to rename to {0}: {1}",
"Fail to scan directory: {0}":"Fail to scan directory: {0}",
"Fail to upload file to: {0}":"Fail to upload file to: {0}",
"Fail to upload to {0}: {1}":"Fail to upload to {0}: {1}",
"Fail to write to file: {0}":"Fail to write to file: {0}",
"Fail to {0} package":"Fail to {0} package",
"File name":"File name",
"File not found {0}":"File not found {0}",
"File {0} copied":"File {0} copied",
"File {0} cut":"File {0} cut",
"File":"File",
"Folder name":"Folder name",
"Format : [name] url":"Format : [name] url",
"Found {0} sections":"Found {0} sections",
"From":"From",
"Full name must be entered":"Full name must be entered",
"Full name":"Full name",
"Error find app by mimes {0}":"Erreur lors de la recherche d'application par mimes {0}",
"Error reading package meta data: {0}":"Erreur lors de la lecture des métadonnées du package: {0}",
"Error saving file {0}":"Erreur lors de l'enregistrement du fichier {0}",
"Exit":"Quitter",
"Fail to create directory: {0}":"Impossible de créer le répertoire: {0}",
"Fail to create {0}: {1}":"Échec de la création de {0}: {1}",
"Fail to delete {0}: {1}":"Échec de la suppression de {0}: {1}",
"Fail to delete: {0}":"Échec de la suppression: {0}",
"Fail to fetch packages list from: {0}":"Impossible d'extraire la liste des paquets de: {0}",
"Fail to get file meta data: {0}":"Échec d'obtention des métadonnées de fichier: {0}",
"Fail to make request: {0}":"Echec de la demande: {0}",
"Fail to move file: {0} -> {1}":"Échec du déplacement du fichier: {0} -> {1}",
"Fail to paste: {0}":"Impossible de coller: {0}",
"Fail to publish file: {0}":"Échec de la publication du fichier: {0}",
"Fail to query data from database: {0}":"Impossible d'interroger les données de la base de données: {0}",
"Fail to read file: {0}":"Impossible de lire le fichier: {0}",
"Fail to rename to {0}: {1}":"Impossible de renommer en {0}: {1}",
"Fail to scan directory: {0}":"Échec de l'analyse du répertoire: {0}",
"Fail to upload file to: {0}":"Impossible de télécharger le fichier vers: {0}",
"Fail to upload to {0}: {1}":"Impossible de télécharger vers {0}: {1}",
"Fail to write to file: {0}":"Échec de l'écriture dans le fichier: {0}",
"Fail to {0} package":"Échec du {0} paquet",
"File name":"Nom de fichier",
"File not found {0}":"Fichier introuvable {0}",
"File {0} copied":"Fichier {0} copié",
"File {0} cut":"Fichier {0} coupé",
"File":"Fichier",
"Folder name":"Nom de dossier",
"Format : [name] url":"Format: [nom] url",
"Found {0} sections":"{0} sections trouvées",
"From":"De",
"Full name must be entered":"Le nom complet doit être ent",
"Full name":"Nom complet",
"Google Drive":"Google Drive",
"Hidden files":"Hidden files",
"Home":"Home",
"Icon view":"Icon view",
"Ignore all {0} unsaved files ?":"Ignore all {0} unsaved files ?",
"Install":"Install",
"Invalid package: Meta data file not found":"Invalid package: Meta data file not found",
"Kill process":"Kill process",
"Language file {0} not found":"Language file {0} not found",
"Launch":"Launch",
"List view":"List view",
"Location":"Location",
"Log out":"Log out",
"Logout":"Logout",
"Mime type {0} is not supported":"Mime type {0} is not supported",
"Modify section entry":"Modify section entry",
"Move to":"Move to",
"Name":"Name",
"Navigation bar":"Navigation bar",
"New file":"New file",
"New folder":"New folder",
"New section entry for {0}":"New section entry for {0}",
"New":"New",
"No application available to open {0}":"No application available to open {0}",
"No post found: {0}":"No post found: {0}",
"No":"No",
"Hidden files":"Fichiers cachés",
"Home":"Accueil",
"Icon view":"Vue d'icône",
"Ignore all {0} unsaved files ?":"Ignorer tous les {0} fichiers non enregistrés?",
"Install":"Installer",
"Invalid package: Meta data file not found":"Paquet invalide: Fichier de métadonnées non trouvé",
"Kill process":"Tuer le processus",
"Language file {0} not found":"Fichier de langue {0} introuvable",
"Launch":"Lancer",
"List view":"Vue de liste",
"Location":"Localisation",
"Log out":"Déconnecter",
"Logout":"Déconnecter",
"Mime type {0} is not supported":"Le type MIME {0} n'est pas supporté",
"Modify section entry":"Modifier le texte",
"Move to":"Déplacer vers",
"Name":"Nom",
"Navigation bar":"Barre de navigation",
"New file":"Nouveau fichier",
"New folder":"Nouveau dossier",
"New section entry for {0}":"Nouvelle entrée de section pour {0}",
"New":"Nouveau",
"No application available to open {0}":"Aucune application disponible pour ouvrir {0}",
"No post found: {0}":"Aucun texte trouvé: {0}",
"No":"Non",
"OS":"OS",
"Ok":"Ok",
"Only {0} could be selected":"Only {0} could be selected",
"Open file":"Open file",
"Open with":"Open with",
"Open":"Open",
"Ok":"Oui",
"Only {0} could be selected":"Seul {0} peut être sélectionné",
"Open file":"Ouvrir un fichier",
"Open with":"Ouvrir avec",
"Open":"Ouvrir",
"Options":"Options",
"Package uninstalled":"Package uninstalled",
"Parent can not be the category itself":"Parent can not be the category itself",
"Paste":"Paste",
"Package uninstalled":"Package désinstallé",
"Parent can not be the category itself":"Parent ne peut pas être la catégorie elle-même",
"Paste":"Coller",
"Phone":"Phone",
"Pid":"Pid",
"Please enter category name":"Please enter category name",
"Please enter tags":"Please enter tags",
"Please insert a title in the text: beginning with heading":"Please insert a title in the text: beginning with heading",
"Please select a category":"Please select a category",
"Please select a date":"Please select a date",
"Please select a file":"Please select a file",
"Please select a parent category":"Please select a parent category",
"Please select a section to edit":"Please select a section to edit",
"Please select a section to move":"Please select a section to move",
"Preview":"Preview",
"Properties":"Properties",
"Quit without saving ?":"Quit without saving ?",
"Quit":"Quit",
"Read more":"Read more",
"Refresh":"Refresh",
"Rename":"Rename",
"Repositories":"Repositories",
"Resource not found {0}":"Resource not found {0}",
"Resource not found: {0}":"Resource not found: {0}",
"Row {0}, col {1}, lines: {2}":"Row {0}, col {1}, lines: {2}",
"Save as":"Save as",
"Save":"Save",
"Section list is empty, please add one":"Section list is empty, please add one",
"Select image file":"Select image file",
"Please enter category name":"Veuillez entrer le nom de la catégorie",
"Please enter tags":"Veuillez entrer les tags",
"Please insert a title in the text: beginning with heading":"Veuillez insérer un titre dans le texte: en commençant par le heading",
"Please select a category":"Veuillez sélectionner une catégorie",
"Please select a date":"Veuillez sélectionner une date",
"Please select a file":"Veuillez sélectionner un fichier",
"Please select a parent category":"Veuillez sélectionner une catégorie parente",
"Please select a section to edit":"Veuillez sélectionner une section à modifier",
"Please select a section to move":"Veuillez sélectionner une section à déplacer",
"Preview":"Aperçu",
"Properties":"Propriétés",
"Quit without saving ?":"Quitter sans sauvegarder ?",
"Quit":"Quitter",
"Read more":"Lire la suite",
"Refresh":"Rafraîchir",
"Rename":"Renommer",
"Repositories":"Dépôts",
"Resource not found {0}":"Ressource non trouvée {0}",
"Resource not found: {0}":"Ressource non trouvée: {0}",
"Row {0}, col {1}, lines: {2}":"Range {0}, col {1}, lignes: {2}",
"Save as":"Enregistrer sous",
"Save":"sauvegarder",
"Section list is empty, please add one":"La liste des sections est vide, veuillez en ajouter une",
"Select image file":"Sélectionnez le fichier image",
"Service":"Service",
"Share file":"Share file",
"Shared url: {0}":"Shared url: {0}",
"Shared":"Shared",
"Short biblio":"Short biblio",
"Sidebar":"Sidebar",
"Subtitle":"Subtitle",
"System fail: Cannot init desktop manager":"System fail: Cannot init desktop manager",
"System fail: Cannot init login screen":"System fail: Cannot init login screen",
"Share file":"Partagez le fichier",
"Shared url: {0}":"URL partagée: {0}",
"Shared":"partagé",
"Short biblio":"Biblio court",
"Sidebar":"Barre latérale",
"Subtitle":"Sous-titre",
"System fail: Cannot init desktop manager":"Échec du système: impossible de démarrer le gestionnaire de bureau",
"System fail: Cannot init login screen":"Echec du système: Impossible de se connecter à l'écran de connexion",
"Tags":"Tags",
"This feature is not implemented yet":"This feature is not implemented yet",
"Title or content must not be blank":"Title or content must not be blank",
"Title":"Title",
"Toggle Full screen":"Toggle Full screen",
"Tree view":"Tree view",
"This feature is not implemented yet":"Cette fonctionnalité n'est pas encore implémentée",
"Title or content must not be blank":"Le titre ou le contenu ne doit pas être vide",
"Title":"Titre",
"Toggle Full screen":"Basculer en plein écran",
"Tree view":"Vue de l'arbre",
"Type":"Type",
"Uninstall : {0}?":"Uninstall : {0}?",
"Uninstall":"Uninstall",
"Unknown API setting for {0}":"Unknown API setting for {0}",
"Updated: {0}":"Updated: {0}",
"Upload":"Upload",
"Uninstall : {0}?":"Désinstaller: {0}?",
"Uninstall":"Désinstaller",
"Unknown API setting for {0}":"Paramètre d'API inconnu pour {0}",
"Updated: {0}":"Actualisé: {0}",
"Upload":"Télécharger",
"Url":"Url",
"User abort the authentication":"User abort the authentication",
"User data updated":"User data updated",
"VDB Unknown condition for delete command":"VDB Unknown condition for delete command",
"VFS Cannot encode file: {0}":"VFS Cannot encode file: {0}",
"VFS cannot create : {0}":"VFS cannot create : {0}",
"VFS cannot delete : {0}":"VFS cannot delete : {0}",
"VFS cannot download file : {0}":"VFS cannot download file : {0}",
"VFS cannot get meta data for {0}":"VFS cannot get meta data for {0}",
"VFS cannot init {0}: {1}":"VFS cannot init {0}: {1}",
"VFS cannot move : {0}":"VFS cannot move : {0}",
"VFS cannot read : {0}":"VFS cannot read : {0}",
"VFS cannot save : {0}":"VFS cannot save : {0}",
"VFS cannot write : {0}":"VFS cannot write : {0}",
"VFS unknown action: {0}":"VFS unknown action: {0}",
"VFS unknown handler: {0}":"VFS unknown handler: {0}",
"View":"View",
"Would you like to login to {0}?":"Would you like to login to {0}?",
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url",
"Yes":"Yes",
"{0} is not a directory":"{0} is not a directory"
"User abort the authentication":"L'utilisateur annule l'authentification",
"User data updated":"Données utilisateur mises à jour",
"VDB Unknown condition for delete command":"VDB Condition inconnue pour la commande de suppression",
"VFS Cannot encode file: {0}":"VFS Impossible de coder le fichier: {0}",
"VFS cannot create : {0}":"VFS ne peut pas créer: {0}",
"VFS cannot delete : {0}":"VFS ne peut pas supprimer: {0}",
"VFS cannot download file : {0}":"VFS ne peut pas télécharger le fichier: {0}",
"VFS cannot get meta data for {0}":"VFS ne peut pas obtenir de métadonnées pour {0}",
"VFS cannot init {0}: {1}":"VFS ne peut pas init {0}: {1}",
"VFS cannot move : {0}":"VFS ne peut pas déplacer: {0}",
"VFS cannot read : {0}":"VFS ne peut pas lire: {0}",
"VFS cannot save : {0}":"VFS ne peut pas enregistrer: {0}",
"VFS cannot write : {0}":"VFS ne peut pas écrire: {0}",
"VFS unknown action: {0}":"Action inconnue VFS: {0}",
"VFS unknown handler: {0}":"Gestionnaire inconnu VFS: {0}",
"View":"Vue",
"Would you like to login to {0}?":"Voulez-vous vous connecter à {0}?",
"Wrong format: it should be [name] url":"Mauvais format: il devrait être [nom] url",
"Yes":"Oui",
"{0} is not a directory":"{0} n'est pas un répertoire"
,
"April":"April",
"August":"August",
"December":"December",
"February":"February",
"Fri":"Fri",
"January":"January",
"July":"July",
"June":"June",
"March":"March",
"May":"May",
"Mon":"Mon",
"November":"November",
"October":"October",
"Sat":"Sat",
"Selected: {0} ({1} bytes)":"Selected: {0} ({1} bytes)",
"September":"September",
"Size":"Size",
"Sun":"Sun",
"Thu":"Thu",
"Tue":"Tue",
"Wed":"Wed"
"April":"Avril",
"August":"août",
"December":"Décembre",
"February":"Février",
"Fri":"Ven",
"January":"Janvier",
"July":"Juillet",
"June":"Juin",
"March":"Mars",
"May":"Mai",
"Mon":"Lun",
"November":"Novembre",
"October":"Octobre",
"Sat":"Sam",
"Selected: {0} ({1} bytes)":"Sélectionné: {0} ({1} octets)",
"September":"Septembre",
"Size":"Taille",
"Sun":"Dim",
"Thu":"Jeu",
"Tue":"Mar",
"Wed":"Mer"
,
"Add application":"Ajouter une application",
"Add mount point":"Ajouter un point de montage",
"Add service":"Ajouter un service",
"Appearance":"Apparence",
"Cannot fetch system locales: {0}":"Impossible d'extraire les paramètres régionaux du système: {0}",
"Cannot read wallpaper list from {0}":"Impossible de lire la liste des fonds d'écran à partir de {0}",
"Cannot save system setting: {0}":"Impossible d'enregistrer le paramètre système: {0}",
"Desktop path":"Chemin du bureau",
"Edit mount point":"Modifier le point de montage",
"Languages":"Langues",
"Local packages path":"Chemin d'accès aux packages locaux",
"Mount points":"Points de montage",
"Path":"Chemin",
"Please enter mount point name":"Veuillez entrer le nom du point de montage",
"Please select a directory":"Veuillez sélectionner un répertoire",
"Please select an entry":"Veuillez sélectionner une entrée",
"Remove: {0}?":"Supprimer: {0}?",
"Remove":"Supprimer",
"Select a directory":"Sélectionnez un répertoire",
"Startup applications":"Applications de démarrage",
"Startup services":"Services de démarrage",
"Startup":"Démarrage",
"System locale":"Paramètres régionaux du système",
"System setting saved":"Paramètre système enregistré",
"Theme":"Thème",
"VFS":"VFS",
"Wallpaper":"Fond d'écran"
}

58
src/core/languages/gen.sh Executable file → Normal file
View File

@ -1,4 +1,22 @@
#!/bin/bash
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
ord() {
LC_CTYPE=C printf '%d' "'$1"
}
@ -11,9 +29,10 @@ grep --include=\*.{coffee,tag} -roh "$1" -e '__("[^"]*"' | while read -r line ;
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
fi
done
grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__\([^\"]*\)\"' | while read -r line; do
grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__([^\"]*)\"' | while read -r line; do
len=$(( ${#line} - 6 ))
#echo $len
#echo $line
SUBSTRING=${line:4:len}
#echo $SUBSTRING
if test -f "$2" && [ ! -z "$(grep -F "\"$SUBSTRING\":" "$2")" ]
@ -23,21 +42,26 @@ grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__\([^\"]*\)\"' | while read
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
fi
done
sort tmp.json > tmp1.json
awk '!a[$0]++' "tmp1.json" > tmp.json
sed '$ s/.$//' tmp.json > tmp1.json
# remove duplicate entry
if test -f $2
if test -f tmp.json
then
cp $2 "$2.old"
sed '$ s/.$//' $2 > tmp.json
cat tmp.json > $2
echo "," >> $2
cat tmp1.json >> $2
echo "}" >> "$2"
sort tmp.json > tmp1.json
awk '!a[$0]++' "tmp1.json" > tmp.json
sed '$ s/.$//' tmp.json > tmp1.json
# remove duplicate entry
if test -f $2
then
cp $2 "$2.old"
sed '$ s/.$//' $2 > tmp.json
cat tmp.json > $2
echo "," >> $2
cat tmp1.json >> $2
echo "}" >> "$2"
else
echo "{"> "$2"
cat tmp1.json >> "$2"
echo "}" >> "$2"
fi
rm tmp.json tmp1.json
else
echo "{"> "$2"
cat tmp1.json >> "$2"
echo "}" >> "$2"
fi
rm tmp.json tmp1.json
echo "Nothing change"
fi

View File

@ -255,4 +255,67 @@
"Please select an entry":"Vui lòng chọn 1 mục từ danh sách",
"Startup applications":"Ứng dụng khởi chạy",
"Startup services":"Dịch vụ khởi chạy"
,
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export: {0}":"Cannot export: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Syntax error: {0}":"Syntax error: {0}"
,
"Graph editor":"Graph editor",
"Render":"Render"
,
"add {0} to zip":"add {0} to zip",
"Add files to build target":"Add files to build target",
"and unsaved project":"and unsaved project",
"Build and Run":"Build and Run",
"Build":"Build",
"Build done":"Build done",
"Build Options":"Build Options",
"Build release":"Build release",
"Cannot create file: {0}":"Cannot create file: {0}",
"Cannot save project: {0}":"Cannot save project: {0}",
"Cannot save the zip file {0} : {1}":"Cannot save the zip file {0} : {1}",
"Coffees":"Coffees",
"Compiled successful":"Compiled successful",
"Copied {0} -> {1}":"Copied {0} -> {1}",
"Copied files":"Copied files",
"Created directory: {0}":"Created directory: {0}",
"Created file: {0}":"Created file: {0}",
"Css":"Css",
"Error when create directory: {0}":"Error when create directory: {0}",
"Generated {0}":"Generated {0}",
"Hide":"Hide",
"Ignore: {0} unsaved files {1}?":"Ignore: {0} unsaved files {1}?",
"Ignore unsaved project ?":"Ignore unsaved project ?",
"Installing...":"Installing...",
"Javascripts":"Javascripts",
"Metadata found...":"Metadata found...",
"New Project at":"New Project at",
"New project":"New project",
"Opening {0}":"Opening {0}",
"Open project":"Open project",
"Open Project":"Open Project",
"Output":"Output",
"Please select {0} only":"Please select {0} only",
"Please select a file/fofler":"Please select a file/fofler",
"Preparing for release":"Preparing for release",
"ProjectName":"ProjectName",
"Project":"Project",
"project saved":"project saved",
"Running {0}...":"Running {0}...",
"Select a file":"Select a file",
"Show":"Show",
"Uninstall: {0}?":"Uninstall: {0}?",
"Unsaved project":"Unsaved project",
"Update":"Update",
"Verifying {0}":"Verifying {0}",
"Version string is in invalid format: {0}":"Version string is in invalid format: {0}",
"Welcome to AntOSDK":"Welcome to AntOSDK",
"Your application version is older ({0} < {1})":"Your application version is older ({0} < {1})",
"zip file generated in release folder":"zip file generated in release folder"
}

View File

@ -246,6 +246,25 @@
"Edit mount point":"Sửa điểm truy cập"
,
"Services":"Services",
"Startup":"Startup"
"Services":"Dịch vụ",
"Startup":"Khởi chạy"
,
"Add application":"Thêm ứng dụng",
"Add service":"Thêm dịch vụ",
"Please select an entry":"Vui lòng chọn 1 mục từ danh sách",
"Startup applications":"Ứng dụng khởi chạy",
"Startup services":"Dịch vụ khởi chạy"
,
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export: {0}":"Cannot export: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Syntax error: {0}":"Syntax error: {0}"
,
"Graph editor":"Graph editor",
"Render":"Render"
}

View File

@ -7,3 +7,4 @@
<!--div id = "workingenv"></div-->
</div>
<afx-menu id="contextmenu" data-id="contextmenu" context="true" style="display:none;"></afx-menu>
<afx-label id="systooltip" data-id="systooltip" style="display:none;position:absolute;"></afx-label>

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
self.OS.systemSetting = (conf) ->
_OS.setting.desktop = conf.desktop if conf.desktop
_OS.setting.applications = conf.applications if conf.applications
@ -8,6 +25,7 @@
repeat: "repeat"
} unless _OS.setting.appearance.wp
_OS.setting.appearance.wps = [] unless _OS.setting.appearance.wps
_OS.setting.applications = {} unless _OS.setting.applications
_OS.setting.user = conf.user
_OS.setting.VFS = conf.VFS if conf.VFS
_OS.setting.desktop.path = "home://.desktop" unless _OS.setting.desktop.path

View File

@ -43,6 +43,8 @@
self[i] = v[i]
else
self[k] = v
if(k == "apptitle")
self.root.observable.trigger("apptitlechange")
self.update()
}
self.root.get = function(k)

View File

@ -1,5 +1,5 @@
<afx-apps-dock>
<afx-button class = {selected: parent.selectedApp && app.pid == parent.selectedApp.pid} each={ items } icon = {icon} text = {text} onbtclick = {onbtclick}>
<afx-button class = {selected: parent.selectedApp && it.app.pid == parent.selectedApp.pid} each={ it,i in items} iconclass = {it.iconclass} icon = {it.icon} appindex = {i} text = {it.text} onbtclick = {it.onbtclick} tooltip= {"cr:" + it.app.title()} >
</afx-button>
<script>
this.items = opts.items || []
@ -48,6 +48,10 @@
self.update()
}
}
self.root.update = function()
{
self.update()
}
self.root.get = function(k)
{
return self[k]
@ -56,5 +60,23 @@
window.OS.courrier.trigger("sysdockloaded")
})
self.root.contextmenuHandler = function(e, m)
{
if(e.target == self.root) return;
var appidx = $(e.target).closest( "afx-button" ).attr("appindex")
var app = self.items[appidx].app
m.set("items", [
{ text: "__(Show)", dataid:"show" },
{ text: "__(Hide)", dataid:"hide" },
{ text: "__(Close)", dataid:"quit" }
])
m.set("onmenuselect", function(evt)
{
if(app[evt.item.data.dataid])
app[evt.item.data.dataid]()
})
m.show(e)
}
</script>
</afx-apps-dock>

View File

@ -1,13 +1,16 @@
<afx-button>
<button disabled={ enable == "false" } onclick="{ _onbtclick }" ref = "mybtn" >
<afx-button >
<button class= { btactive: selected } disabled={ enable == false } onclick="{ _onbtclick }" ref = "mybtn" >
<afx-label color = {color} icon={icon} iconclass = {iconclass} text = {text} ></afx-label>
</button>
<script>
this.enable = opts.enable
opts.enable = opts.enable || "true"
this.enable = eval(opts.enable) || false
this.icon = opts.icon
this.iconclass = opts.iconclass
this.color = opts.color
this.text = opts.text || ""
this.selected = eval(opts.selected) || false
this.toggle = eval(opts.toggle) || false
var self = this
this.onbtclick = opts.onbtclick
self.root.set = function(k,v)
@ -37,6 +40,8 @@
{
self.root.observable.trigger("btclick",{id:$(self.root).attr("data-id"),data:self.root})
}
if(self.toggle)
self.root.set("selected",!self.selected)
}
</script>
</afx-button>

View File

@ -218,6 +218,9 @@
self.root.observable.on("calibrate", function(e){
calibre_size()
})
/*self.root.observable.on("*", function(e){
console.log(e)
})*/
})
</script>
</afx-file-view>

View File

@ -62,8 +62,7 @@
}
else
{
$(this)
.css("flex-grow","1")
$(this).css("flex-grow","1")
auto_width.push(this)
}
})

View File

@ -1,6 +1,8 @@
<afx-list-view class = {dropdown: opts.dropdown == "true"} style = "display:flex; flex-direction:column">
<div class = "list-container" ref = "container" style="flex:1;">
<div if = {opts.dropdown == "true"} ref = "current" style = {opts.width?"min-width:" + opts.width + "px;":""} onclick = {show_list}></div>
<div if = {opts.dropdown == "true"} ref = "current" onclick = {show_list}>
<afx-label ref = "drlabel"></afx-label>
</div>
<ul ref = "mlist" >
<li each={item,i in items } class={selected: parent._autoselect(item,i)} ondblclick = {parent._dbclick} onclick = {parent._select} oncontextmenu = {parent._select}>
<afx-label class = {item.class} color = {item.color} iconclass = {item.iconclass} icon = {item.icon} text = {item.text}></afx-label>
@ -119,9 +121,18 @@
if(opts.dropdown == "true")
{
self.root.observable.on("calibrate", function(){
var cl = function()
{
$(self.refs.container).css("width", $(self.root).width() + "px" )
$(self.refs.current).css("width", $(self.root).width() + "px" )
$(self.refs.mlist).css("width", $(self.root).width() + "px" )
}
cl()
self.root.observable.on("calibrate", function(){
cl()
})
self.root.observable.on("resize", function(){
cl()
})
$(document).click(function(event) {
if(!$(event.target).closest(self.refs.container).length) {
@ -180,7 +191,8 @@
if(opts.dropdown == "true")
{
$(self.refs.mlist).hide()
$(self.refs.current).html(it.text.__())
self.refs.drlabel.root.set("*",it)
}
if(self.onlistselect)

View File

@ -118,11 +118,15 @@
{
if(opts.context == "true")
{
if(event.button == 2 || event.originalEvent.button == 2)
{
return
}
if(!$(event.target).closest(self.root).length) {
$(self.root).hide()
$(document).unbind("click",mnhide)
}
return;
return
}
if(!$(event.target).closest(self.refs.container).length && self.refs.container) {
var arr = self.refs.container.length?self.refs.container:[self.refs.container]

View File

@ -0,0 +1,100 @@
<afx-nspinner>
<input ref = "holder" type="text" value = {value}></input>
<ul ref = "spinner">
<li class = "incr" ref= "incr" onclick="{ _incr }"> <i></i> </li>
<li class = "decr" ref = "decr" onclick="{ _decr }"> <i></i> </li>
</ul>
<script>
this.value = eval(opts.value) || 0
this.step = Number(opts.step) || 1
this.onchange = opts.onchange
var self = this
this.rid = $(self.root).attr("data-id") || Math.floor(Math.random() * 100000) + 1
self.root.set = function(k,v)
{
if(k == "*")
for(var i in v)
self[i] = v[i]
else
self[k] = v
self.update()
}
self.root.get = function(k)
{
return self[k]
}
self._incr = function(e)
{
self.value = self.value + self.step;
self.update();
if(self.onchange) self.onchange(self.value);
}
self.on("mount", function(){
self.root.observable = opts.observable || (self.parent && self.parent.root && self.parent.root.observable) || riot.observable()
$(self.refs.spinner).css("width", "20px" );
var cl = function()
{
$(self.refs.holder).css("width", $(self.root).width() - 20 + "px" )
$(self.refs.holder).css("height", $(self.root).height() + "px" )
$(self.refs.spinner)
.css("width","20px")
.css("height", $(self.root).height() + "px" )
$(self.refs.incr)
.css("height", $(self.root).height()/2 - 2 + "px")
.css("position", "relative")
$(self.refs.decr).css("height", $(self.root).height()/2 -2 + "px")
.css("position", "relative")
$(self.refs.spinner).find("li")
.css("display","block")
.css("text-align", "center")
.css("vertical-align", "middle")
$(self.refs.spinner).find("i")
.css("font-size", "16px")
.css("position", "absolute")
var fn = function(ie, pos)
{
var el = $(ie).find("i")
el
.css(pos,($(ie).height()-el.height()) /2 + "px" )
.css("left", ($(ie).width()-el.width())/2 + "px" )
}
fn(self.refs.decr, "bottom")
fn(self.refs.incr, "top")
}
cl()
self.root.observable.on("calibrate", function(){
cl()
})
self.root.observable.on("resize", function(){
cl()
});
$(self.refs.holder).on('keyup', function (e) {
if (e.keyCode == 13) {
var val = self.refs.holder.value;
if(!isNaN(val))
{
val = eval(val)
if(val < 0)
val = self.value;
self.value = val;
}
self.refs.holder.value = self.value;
if(self.onchange) self.onchange(self.value);
}
});
})
self._decr = function(e)
{
if(self.value == 0) return;
self.value = self.value - self.step;
self.update();
if(self.onchange) self.onchange(self.value);
}
</script>
</afx-nspinner>

View File

@ -9,6 +9,7 @@
//self.parent = $(self.root).parent().parent()
var tagname = $(self.parent.root).prop("tagName")
self.resizable = $(self.root).prev().length == 1 ? $(self.root).prev()[0]: undefined
//self.nextel = $(self.root).next().length == 1 ? $(self.root).next()[0]: undefined
if(tagname == "AFX-HBOX")
{
self.dir = "hz"
@ -32,7 +33,8 @@
//$(self.root).css("cursor", "normal")
self.dir = "none"
}
if(!self.minsize)
self.minsize = 10
enable_dragging()
})

View File

@ -0,0 +1,107 @@
<afx-slider>
<div class= "container" ref="container">
<div class = "progress" ref ="prg"></div>
<div if = {dragable} class = "dragpoint" ref = "point"></div>
</div>
<script>
this.value = Number(opts.value) || 0
this.max = Number(opts.max) || 100
if(opts.dragable != undefined)
this.dragable = eval(opts.dragable)
else
this.dragable = true
this.onchanging = opts.onchanging
this.onchange = opts.onchange
//this.rid = $(self.root).attr("data-id") || Math.floor(Math.random() * 100000) + 1
var self = this
self.root.set = function(k,v)
{
if(k == "*")
for(var i in v)
self[i] = v[i]
else
self[k] = v
/*if(k == "value")
{
if(self.onchange) self.onchange(self.value)
if(self.onchanging) self.onchanging(self.value)
}*/
self.update()
}
self.root.get = function(k)
{
return self[k]
}
var calibrate = function() {
if(self.value > self.max) self.value = self.max
$(self.refs.container).css("width", $(self.root).width() + "px")
var w = $(self.refs.container).width()*self.value/ self.max
$(self.refs.prg).css("width", w + "px").css("height", $(self.refs.container).height()+"px")
if(self.dragable)
{
var ow = w - $(self.refs.point).width()/2
var top = Math.floor(($(self.refs.prg).height() - $(self.refs.point).height())/2)
$(self.refs.point).css("left", ow + "px").css("top", top + "px")
}
}
self.on("update", function(){
calibrate()
})
var enable_dragging = function()
{
$(self.refs.point)
.css("user-select","none")
.css("cursor","default")
$(self.refs.point).on("mousedown", function(e){
e.preventDefault()
offset = $(self.refs.container).offset()
$(window).on("mousemove", function(e){
var left
left = e.clientX - offset.left
left = left < 0?0:left
var maxw = $(self.refs.container).width();
left = left > maxw?maxw : left
self.value = left*self.max/maxw
calibrate()
if(self.onchanging) self.onchanging(self.value)
})
$(window).on("mouseup", function(e){
if(self.onchange) self.onchange(self.value)
$(window).unbind("mousemove", null)
$(window).unbind("mouseup", null)
})
})
}
self.on("mount", function(){
self.root.observable = opts.observable || (self.parent && self.parent.root && self.parent.root.observable) || riot.observable()
if(self.dragable)
{
$(self.refs.point).css("position", "absolute")
$(self.refs.point).hide()
$(self.root).mouseover(function(){
$(self.refs.point).show()
}).mouseout(function(){
$(self.refs.point).hide()
})
enable_dragging()
}
$(self.refs.container).click( function(e){
var offset = $(self.refs.container).offset()
var left = e.clientX - offset.left
var maxw = $(self.refs.container).width()
self.value = left*self.max/maxw
calibrate()
if(self.onchange) self.onchange(self.value)
if(self.onchanging) self.onchanging(self.value)
})
self.root.observable.on("calibrate",function(){
calibrate()
})
self.root.observable.on("resize", function(){
calibrate()
})
calibrate()
})
</script>
</afx-slider>

View File

@ -41,12 +41,13 @@
{
if(!self.enable) return
opts.swon = !self.swon
self.swon = opts.swon
var data = {
id: self.rid,
data: opts.swon
}
if(self.onchange)
self.onchange(data)
if(opts.onchange)
opts.onchange(data)
if(self.root.observable)
self.root.observable.trigger("switch", data)

View File

@ -4,9 +4,6 @@
var self = this
this.closable = opts.closable || false
self.ontabselect = opts.ontabselect
get_observable(){
return self.root.observable
}
self.root.get = function (k) {
return self.refs.list.root.get(k)

View File

@ -64,8 +64,7 @@
}
else
{
$(this)
.css("flex-grow","1")
$(this).css("flex-grow","1")
auto_height.push(this)
}
})

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
String.prototype.asFileHandler = () ->
list = @split "://"
handlers = _API.VFS.findHandlers list[0]
@ -51,11 +68,12 @@ class BaseFileHandler
return -1 unless @path
return @path.hash()
sendB64: (m, f) ->
sendB64: (p, f) ->
me = @
m = if p is "object" then "text/plain" else p
return f "" unless @cache
if typeof @cache is "string"
b64 = @cache.asBase64()
if p is "object" or typeof @cache is "string"
b64 = if p is "object" then (JSON.stringify @cache).asBase64() else @cache.asBase64()
b64 = "data:#{m};base64,#{b64}"
f(b64)
else
@ -130,6 +148,7 @@ class BaseFileHandler
meta: (f) ->
getlink: () -> @path
# for main action read, write, remove, execute
# must be implemented by subclasses
action: (n, p, f) ->
@ -146,6 +165,9 @@ class RemoteFileHandler extends self.OS.API.VFS.BaseFileHandler
meta: (f) ->
_API.handler.fileinfo @path, f
getlink: () ->
_API.handler.get + "/" + @path
action: (n, p, f) ->
me = @
switch n
@ -158,6 +180,7 @@ class RemoteFileHandler extends self.OS.API.VFS.BaseFileHandler
return f { error: __("{0} is not a directory", @path) } if @info.type is "file"
_API.handler.mkdir "#{@path}/#{p}", f
when "write"
return _API.handler.write me.path, me.cache, f if p is "base64"
@sendB64 p, (data) ->
_API.handler.write me.path, data, f
when "upload"
@ -272,6 +295,25 @@ class BufferFileHandler extends self.OS.API.VFS.BaseFileHandler
self.OS.API.VFS.register "^mem$", BufferFileHandler
class URLFileHandler extends self.OS.API.VFS.BaseFileHandler
constructor: (path) ->
super path
@ready = true
meta: (f) ->
f { result: true }
action: (n, p, f) ->
me = @
switch n
when "read"
_API.get @path, (d) ->
f(d)
, (e, s) ->
_courrier.oserror __("VFS cannot read : {0}", me.path), e, s
, if p then p else "text"
else
return _courrier.oserror __("VFS unknown action: {0}", n), (_API.throwe "OS.VFS"), n
self.OS.API.VFS.register "^(http|https)$", URLFileHandler
class SharedFileHandler extends self.OS.API.VFS.BaseFileHandler
constructor: (path) ->
super path

View File

@ -1,4 +1,22 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
# GoogleDrive File Handler
G_CACHE = {"gdv://":{ id: "root", mime: 'dir' } }
@ -122,10 +140,14 @@ class GoogleDriveHandler extends this.OS.API.VFS.BaseFileHandler
error xhr, xhr.status
xhr.onerror = () ->
error xhr, xhr.status
return xhr.send me.cache.replace /^data:[^;]+;base64,/g, "" if m is "base64"
@sendB64 m, (data) ->
xhr.send data.replace /^data:[^;]+;base64,/g, ""
getlink: () ->
return @info.webContentLink if @ready
return undefined
action: (n, p, f) ->
me = @
q = _courrier.getMID()

View File

@ -1,3 +1,22 @@
<!--
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
-->
<!DOCTYPE html>
<html lang="en">
<head>

0
src/libs/jszip.min.js vendored Executable file → Normal file
View File

3
src/libs/showdown.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
_PM = this.OS.PM
_APP = this.OS.APP
class ActivityMonitor extends this.OS.GUI.BaseApplication
@ -12,7 +29,7 @@ class ActivityMonitor extends this.OS.GUI.BaseApplication
item = me.grid.get "selected"
return unless item
app = _PM.appByPid item[0].value
app.quit() if app
app.quit(true) if app
header = [{width:50,value: "__(Pid)"},{value:"__(Name)"}, {value:"__(Type)", width:80},{width:75,value: "__(Alive (ms))"}]
@gdata =

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1a",
"version":"0.0.1-a",
"category":"System",
"iconclass":"fa fa-heartbeat",
"mimes":["none"]

View File

@ -0,0 +1,11 @@
coffee_files = main.coffee dialog.coffee
jsfiles = coffeescript.js
cssfiles = main.css
copyfiles = scheme.html welcome.html package.json
PKG_NAME=AntOSDK
include ../pkg.mk

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,109 @@
class BuildDialog extends this.OS.GUI.BasicDialog
constructor: () ->
super "BuildDialog", {
tags: [
{ tag: "afx-label", att: 'text="__(Coffees)" data-height="23" class="header"' },
{ tag: "afx-list-view" }
{ tag: "afx-label", att: 'text="__(Javascripts)" data-height="23" class="header"' },
{ tag: "afx-list-view" }
{ tag: "afx-label", att: 'text="__(Css)" data-height="23" class="header"' },
{ tag: "afx-list-view" }
{ tag: "afx-label", att: 'text="__(Copied files)" data-height="23" class="header"' },
{ tag: "afx-list-view" }
{ tag: "div", att: ' data-height="5"' }
],
width: 350,
height: 450,
resizable: true,
buttons: [
{
label: "__(Save)", onclick: (d) ->
data =
coffees: (v.text for v in (d.find "content1").get "items")
javascripts: (v.text for v in (d.find "content3").get "items")
css: (v.text for v in (d.find "content5").get "items")
copies: (v.text for v in (d.find "content7").get "items")
d.handler data if d.handler
d.quit()
},
{ label: "__(Cancel)", onclick: (d) -> d.quit() }
],
filldata: (d) ->
lv = d.find "content1"
lv.set "items", ({ text: v } for v in d.parent.prjfile.cache.coffees)
lv.set "buttons", [
{
text: "+",
onbtclick: (e) ->
d.selectFile ["text/.*coffeescript"], (f) ->
lv.push { text: f }, true if f
},
{
text: "-",
onbtclick: (e) ->
sel = lv.get "selected"
return unless sel
lv.remove sel, true
}
]
lv1 = d.find "content3"
lv1.set "items", ({ text: v } for v in d.parent.prjfile.cache.javascripts)
lv1.set "buttons", [
{
text: "+",
onbtclick: (e) ->
d.selectFile ["application/javascript"], (f) ->
lv1.push { text: f }, true if f
},
{
text: "-",
onbtclick: (e) ->
sel = lv1.get "selected"
return unless sel
lv1.remove sel, true
}
]
lv2 = d.find "content5"
lv2.set "items", ({ text: v } for v in d.parent.prjfile.cache.css)
lv2.set "buttons", [
{
text: "+",
onbtclick: (e) ->
d.selectFile ["text/css"], (f) ->
lv2.push { text: f }, true if f
},
{
text: "-",
onbtclick: (e) ->
sel = lv2.get "selected"
return unless sel
lv2.remove sel, true
}
]
lv3 = d.find "content7"
lv3.set "items", ({ text: v } for v in d.parent.prjfile.cache.copies)
lv3.set "buttons", [
{
text: "+",
onbtclick: (e) ->
d.selectFile [".*"], (f) ->
lv3.push { text: f }, true if f
},
{
text: "-",
onbtclick: (e) ->
sel = lv3.get "selected"
return unless sel
lv3.remove sel, true
}
]
}
selectFile: (mimes, f) ->
me = @
@openDialog "FileDiaLog", (d, n, p) ->
f p.replace me.parent.prjfile.cache.root + "/", ""
, "__(Select a file)", { mimes: mimes, type: "file", root: @parent.prjfile.cache.root }

View File

@ -0,0 +1,758 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class AntOSDK extends this.OS.GUI.BaseApplication
constructor: ( args ) ->
super "AntOSDK", args
@prjfile = if @args and @args.length > 0 then @args[0].asFileHandler() else null
loadScheme: () ->
path = "#{@meta().path}/" + if @prjfile then "scheme.html" else "welcome.html"
@render path
main: () ->
me = @
@scheme.set "apptitle", "AntOSDK"
@output = @find "output"
if not @prjfile
(@find "btnnewprj").set "onbtclick", () ->
me.newProject (path) ->
me.prjfile = "#{path}/project.apj".asFileHandler()
me.init()
(@find "btnopenprj").set "onbtclick", () ->
me.actionProject "#{me.name}-Open"
return
@initWorkspace()
initWorkspace: () ->
me = @
@dirty = true
@fileview = @find "fileview"
div = @find "datarea"
@currfile = "Untitled".asFileHandler()
ace.require "ace/ext/language_tools"
@prjfile.dirty = false
@.editor = ace.edit div
@.editor.setOptions {
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true,
fontSize: "13px"
}
@.editor.completers.push { getCompletions: ( editor, session, pos, prefix, callback ) -> }
@.editor.getSession().setUseWrapMode true
@fileview.contextmenuHandler = (e, m) ->
m.set "items", me.contextMenu()
m.set "onmenuselect", (evt) ->
me.contextAction evt
m.show e
@mlist = @find "modelist"
@modes = ace.require "ace/ext/modelist"
ldata = []
f = (m, i) ->
ldata.push {
text: m.name,
mode: m.mode,
selected: if m.mode is 'ace/mode/text' then true else false
}
m.idx = i
f(m, i) for m, i in @modes.modes
@mlist.set "items", ldata
@mlist.set "onlistselect", (e) ->
me.editor.session.setMode e.data.mode
themelist = @find "themelist"
themes = ace.require "ace/ext/themelist"
ldata = []
ldata.push {
text: m.caption,
mode: m.theme,
selected: if m.theme is "ace/theme/monokai" then true else false
} for k, m of themes.themesByName
themelist.set "onlistselect", (e) ->
me.editor.setTheme e.data.mode
themelist.set "items", ldata
statbar = @find "editorstat"
#status
stup = (e) ->
c = me.editor.session.selection.getCursor()
l = me.editor.session.getLength()
statbar.set "text", __("Row {0}, col {1}, lines: {2}", c.row, c.column, l)
stup(0)
@.editor.getSession().selection.on "changeCursor", (e) -> stup(e)
@editormux = false
@editor.on "input", () ->
if me.editormux
me.editormux = false
return false
if not me.currfile.dirty
me.currfile.dirty = true
me.currfile.text += "*"
me.tabarea.update()
@on "resize", () -> me.editor.resize()
@on "vboxchange", () -> me.editor.resize()
@on "focus", () -> me.editor.focus()
@fileview.set "fetch", (e, f) ->
return unless e.child
return if e.child.filename is "[..]"
e.child.path.asFileHandler().read (d) ->
return me.error __("Resource not found {0}", e.child.path) if d.error
f d.result
@fileview.set "onfileopen", (e) ->
return if e.type is "dir"
me.open e.path.asFileHandler()
@subscribe "VFS", (d) ->
p = (me.fileview.get "path").asFileHandler()
me.chdir p.path if d.data.file.hash() is p.hash() or d.data.file.parent().hash() is p.hash()
@tabarea = @find "tabarea"
@tabarea.set "ontabselect", (e) ->
me.selecteTab e.idx
@tabarea.set "onitemclose", (e) ->
it = e.item.item
return false unless it
return me.closeTab it unless it.dirty
me.openDialog "YesNoDialog", (d) ->
return me.closeTab it if d
me.editor.focus()
, __("Close tab"), { text: __("Close without saving ?") }
return false
(@find "log-clear").set "onbtclick", (e) ->
($ me.output).empty()
#@tabarea.set "closable", true
@bindKey "ALT-N", () -> me.actionFile "#{me.name}-New"
@bindKey "ALT-O", () -> me.actionFile "#{me.name}-Open"
@bindKey "CTRL-S", () -> me.actionFile "#{me.name}-Save"
@bindKey "ALT-W", () -> me.actionFile "#{me.name}-Saveas"
@bindKey "CTRL-R", () -> me.bnR()
@bindKey "ALT-C", () -> me.actionBuild "#{me.name}-Build"
@bindKey "ALT-P", () -> me.buildAndRelease()
@bindKey "ALT-Y", () ->
me.actionBuild "#{me.name}-Options"
@openProject @prjfile if @prjfile
@trigger "calibrate"
newProject: (f) ->
me = @
@openDialog "FileDiaLog", (d, n, p) ->
rpath = "#{d}/#{n}"
# create folder
# create javascripts dir
# create css dir
# create coffees dir
# create asset dir
dirs = [
rpath,
"#{rpath}/build",
"#{rpath}/build/release",
"#{rpath}/build/debug",
"#{rpath}/javascripts",
"#{rpath}/css",
"#{rpath}/coffees",
"#{rpath}/assets"
]
fn = (list, f1) ->
return f1() if list.length is 0
dir = (list.splice 0, 1)[0].asFileHandler()
name = dir.basename
dir = dir.parent().asFileHandler()
dir.mk name, (r) ->
return me.error __("Error when create directory: {0}", r.error) if r.error
me.log "INFO", __("Created directory: {0}", dir.path + "/" + name)
#console.log "created", dir.path + "/" + name
fn list, f1
fn dirs, () ->
# create package.json
# create README.md
# create project.apj
# create coffees/main.coffee
# create shemes/scheme.html
files = [
{
path: "#{rpath}/package.json",
content: """
{
"app":"#{n}",
"name":"#{n}",
"description":"",
"info":{
"author": "",
"email": ""
},
"version":"0.0.1-a",
"category":"Other",
"iconclass":"fa fa-adn",
"mimes":["none"]
}"""
},
{
path: "#{rpath}/README.md",
content: """
# #{n}
This is an example project, generated by AntOS Development Kit
## Howto
1. Open the project.apj file with AntOSDK (simply double Click on it)
2. Modify the UI in *assets/scheme.html*
3. Modify application code in *coffees/main.coffee*
4. Modify CSS style in *css/main.css*
5. Other files need to be copied: put in to assets
## Set up build target
Click **Menu> Build > Build Option** or simply hit **ALT-Y**
In the build options dialog, add or remove files that need to be
included into the build
Click **Save**
## Build application
* To build: **Menu > Build > Build** or **ALT-C**
* To build and run: **Menu > Build > Build and Run** or **CTRL-R**
* To release: **Menu > Build > Build release** or **ALT-P**
"""
},
{
path: "#{rpath}/project.apj",
content: """
{
"name": "#{n}",
"root": "#{d}/#{n}",
"css": [],
"javascripts": [],
"coffees": ["coffees/main.coffee"],
"copies": ["assets/scheme.html", "package.json", "README.md"]
}
"""
},
{
path: "#{rpath}/coffees/main.coffee",
content: """
class #{n} extends this.OS.GUI.BaseApplication
constructor: ( args ) ->
super "#{n}", args
main: () ->
this.OS.register "#{n}", #{n}
"""
},
{
path: "#{rpath}/assets/scheme.html",
content: """
<afx-app-window apptitle="#{n}" width="600" height="500" data-id="#{n}">
<afx-hbox ></afx-hbox>
</afx-app-window>
"""
}
]
fn1 = (list, f2) ->
return f2(rpath) if list.length is 0
entry = (list.splice 0, 1)[0]
file = entry.path.asFileHandler()
file.cache = entry.content
file.write "text/plain", (res) ->
return me.error __("Cannot create file: {0}", res.error) if res.error
me.log "INFO", __("Created file: {0}", file.path)
fn1 list, f2
fn1 files, f
, "__(New Project at)", { file: { basename: __("ProjectName") } }
openProject: (file) ->
me = @
me.prjfile = file
if(me.tabarea)
file.read (data) ->
me.log "INFO", __("Opening {0}", me.prjfile.path)
fn = (d, dt) ->
me.tabarea.set "selected", -1
me.tabarea.set "items", []
me.currfile = "#{d.root}/README.md".asFileHandler()
me.currfile.dirty = dt
me.chdir d.root if d.root
me.prjfile.cache = d
me.log "INFO", __("Opening {0}", me.currfile.path)
me.open me.currfile
# verify if the path is ok
data.root.asFileHandler().onready () ->
fn(data, false)
, (e) ->
# try the current folder of the project file
pr = file.parent()
me.log "INFO", __("Project root folder not found, try {0}", pr)
pr.asFileHandler().onready () ->
data.root = pr
fn(data, true)
, (e) ->
me.error __("Cannot find the project root, please modify the project file")
,"json"
else
me.init()
open: (file) ->
#find table
i = @findTabByFile file
return @tabarea.set "selected", i if i isnt -1
return @newtab file if file.path.toString() is "Untitled"
me = @
file.read (d) ->
file.cache = d or ""
me.newtab file
contextMenu: () ->
[
{ text: __("New file"), dataid: "#{@name}-mkf" },
{ text: __("New folder"), dataid: "#{@name}-mkd" },
{ text: __("Delete"), dataid: "#{@name}-rm" }
{ text: __("Refresh"), dataid: "#{@name}-refresh" }
]
contextAction: (e) ->
me = @
file = @fileview.get "selectedFile"
dir = if file then file.path.asFileHandler() else (@fileview.get "path").asFileHandler()
dir = dir.parent().asFileHandler() if file and file.type isnt "dir"
switch e.item.data.dataid
when "#{@name}-mkd"
@openDialog "PromptDialog",
(d) ->
dir.mk d, (r) ->
me.error __("Fail to create {0}: {1}", d, r.error) if r.error
, "__(New folder)"
when "#{@name}-mkf"
@openDialog "PromptDialog",
(d) ->
fp = "#{dir.path}/#{d}".asFileHandler()
fp.write "", (r) ->
me.error __("Fail to create {0}: {1}", d, r.error) if r.error
, "__(New file)"
when "#{@name}-rm"
return unless file
@openDialog "YesNoDialog",
(d) ->
return unless d
file.path.asFileHandler()
.remove (r) ->
me.error __("Fail to delete {0}: {1}", file.filename, r.error) if r.error
, "__(Delete)" ,
{ iconclass: "fa fa-question-circle", text: __("Do you really want to delete: {0}?", file.filename) }
when "#{@name}-refresh"
@.chdir ( @fileview.get "path" )
save: (file) ->
me = @
file.write "text/plain", (d) ->
return me.error __("Error saving file {0}", file.basename) if d.error
me.dirty = true
file.dirty = false
file.text = file.basename
me.tabarea.update()
findTabByFile: (file) ->
lst = @tabarea.get "items"
its = ( i for d, i in lst when d.hash() is file.hash() )
return -1 if its.length is 0
return its[0]
closeTab: (it) ->
@tabarea.remove it, false
cnt = @tabarea.get "count"
if cnt is 0
@open "Untitled".asFileHandler()
return false
@tabarea.set "selected", cnt - 1
return false
newtab: (file) ->
file.text = if file.basename then file.basename else file.path
file.cache = "" unless file.cache
file.um = new ace.UndoManager()
@currfile.selected = false
file.selected = true
#console.log cnt
@tabarea.push file, true
#@currfile = @file
#TODO: fix problem : @tabarea.set "selected", cnt
selecteTab: (i) ->
#return if i is @tabarea.get "selidx"
file = (@tabarea.get "items")[i]
return unless file
@fileview.set "preventUpdate", true
@scheme.set "apptitle", file.text.toString()
#return if file is @currfile
if @currfile isnt file
@currfile.cache = @editor.getValue()
@currfile.cursor = @editor.selection.getCursor()
@currfile = file
m = "ace/mode/text"
m = (@modes.getModeForPath file.path) if file.path.toString() isnt "Untitled"
@mlist.set "selected", m.idx
@editormux = true
@editor.setValue file.cache, -1
@editor.session.setMode m.mode
@editor.session.setUndoManager file.um
if file.cursor
@editor.renderer.scrollCursorIntoView { row: file.cursor.row, column: file.cursor.column }, 0.5
@editor.selection.moveTo file.cursor.row, file.cursor.column
@editor.focus()
chdir: (pth) ->
#console.log "called", @_api.throwe("FCK")
return unless pth
me = @
dir = pth.asFileHandler()
dir.read (d) ->
if(d.error)
return me.error __("Resource not found {0}", p)
if not dir.isRoot()
p = dir.parent().asFileHandler()
p.filename = "[..]"
p.type = "dir"
#p.size = 0
d.result.unshift p
($ me.navinput).val dir.path
me.fileview.set "path", pth
me.fileview.set "data", d.result
menu: () ->
me = @
menu = [
{
text: "__(Project)",
child: [
{ text: "__(New)", dataid: "#{@name}-New", },
{ text: "__(Open)", dataid: "#{@name}-Open" },
{ text: "__(Save)", dataid: "#{@name}-Save" }
],
onmenuselect: (e) -> me.actionProject e.item.data.dataid
},
{
text: "__(File)",
child: [
{ text: "__(New)", dataid: "#{@name}-New", shortcut: "A-N" },
{ text: "__(Open)", dataid: "#{@name}-Open", shortcut: "A-O" },
{ text: "__(Save)", dataid: "#{@name}-Save", shortcut: "C-S" },
{ text: "__(Save as)", dataid: "#{@name}-Saveas", shortcut: "A-W" }
],
onmenuselect: (e) -> me.actionFile e.item.data.dataid
},
{
text: "__(Build)",
child: [
{ text: "__(Build and Run)", dataid: "#{@name}-Run", shortcut: "C-R" },
{ text: "__(Build release)", dataid: "#{@name}-Release", shortcut: "A-P" },
{ text: "__(Build)", dataid: "#{@name}-Build", shortcut: "A-C" },
{ text: "__(Build Options)", dataid: "#{@name}-Options", shortcut: "A-Y" }
],
onmenuselect: (e) -> me.actionBuild e.item.data.dataid
}
]
menu
actionFile: (e) ->
me = @
return unless @prjfile
saveas = () ->
me.openDialog "FileDiaLog", (d, n) ->
file = "#{d}/#{n}".asFileHandler()
file.cache = me.currfile.cache
file.dirty = me.currfile.dirty
file.um = me.currfile.um
file.cursor = me.currfile.cursor
file.selected = me.currfile.selected
file.text = me.currfile.text
me.tabarea.replaceItem me.currfile, file, false
me.currfile = file
me.save me.currfile
, "__(Save as)", { file: me.currfile }
switch e
when "#{@name}-Open"
@openDialog "FileDiaLog", ( d, f ) ->
me.open "#{d}/#{f}".asFileHandler()
, "__(Open file)"
when "#{@name}-Save"
@currfile.cache = @editor.getValue()
return @save @currfile if @currfile.basename
saveas()
when "#{@name}-Saveas"
@currfile.cache = @editor.getValue()
saveas()
when "#{@name}-New"
@open "Untitled".asFileHandler()
actionProject: (e) ->
me = @
switch e
when "#{@name}-Open"
fn = () ->
me.openDialog "FileDiaLog", (d, f, p) ->
me.prjfile = "#{d}/#{f}".asFileHandler()
me.log "clean"
me.openProject me.prjfile
, "__(Open Project)", { mimes: me.meta().mimes }
return fn() unless @isDirty()
@ask "__(Unsaved project)", "__(Ignore unsaved project ?)", () ->
fn()
when "#{@name}-New"
fn = () ->
me.log "clean"
me.newProject (p) ->
me.openProject "#{p}/project.apj".asFileHandler()
return fn() unless @isDirty()
@ask "__(Unsaved project)", "__(Ignore unsaved project ?)", () ->
fn()
when "#{@name}-Save"
return unless @prjfile
@prjfile.write "object", (r) ->
return me.error __("Cannot save project: {0}", r.error) if r.error
me.notify __("project saved")
me.prjfile.dirty = false
actionBuild: (e) ->
me = @
return unless @prjfile
switch e
when "#{@name}-Run" then me.bnR()
when "#{@name}-Build"
me.build().then(() ->).catch (ex) ->
me.log "ERROR", ex.toString()
when "#{@name}-Release"
me.buildAndRelease()
when "#{@name}-Options"
me.openDialog new BuildDialog(), (d) ->
me.prjfile.cache[k] = v for k, v of d
me.prjfile.dirty = true
me.dirty = true
, "__(Add files to build target)"
isDirty: () ->
return false unless @tabarea
dirties = ( v for v in @tabarea.get "items" when v.dirty )
return true if dirties.length > 0 or @prjfile.dirty
return false
cleanup: (evt) ->
return unless @currfile
return unless @isDirty()
me = @
evt.preventDefault()
dirties = ( v for v in @tabarea.get "items" when v.dirty )
m = __("Ignore: {0} unsaved files {1}?", dirties.length, if @prjfile.dirty then "__(and unsaved project)" else "")
@ask "__(Quit)", m, () ->
v.dirty = false for v in dirties
me.prjfile.dirty = false
me.quit()
log: (t, m) ->
return $(@output).empty() if t is "clean"
p = ($ "<p>").attr("class", t.toLowerCase())[0]
$(p).html "#{t}: #{m.__()}"
($ @output).append p
($ @output).scrollTop @output.scrollHeight
verify: () ->
me = @
return new Promise (r, e) ->
return e me._api.throwe "Project not found" unless me.prjfile.cache
# perform the verification on each coffee file
list = ("#{me.prjfile.cache.root}/#{v}" for v in me.prjfile.cache.coffees)
return r() if list.length is 0
fn = (l) ->
return r() if l.length is 0
f = (l.splice 0, 1)[0].asFileHandler()
me.log "INFO", __("Verifying {0}", f.path)
f.read (d) ->
try
CoffeeScript.nodes d
fn l
catch ex
e ex
return fn list
cat: (files, t) ->
me = @
return new Promise (r, e) ->
fn = (l) ->
return r(t) if l.length is 0
f = (l.splice 0, 1)[0].asFileHandler()
f.read (d) ->
t = t + "\n" + d
fn l
return fn files
copy: (files, to) ->
me = @
return new Promise (r, e) ->
fn = (l) ->
return r() if l.length is 0
f = (l.splice 0, 1)[0].asFileHandler()
tof = "#{to}/#{f.basename}".asFileHandler()
f.read (d) ->
tof.cache = new Blob [d], { type: f.info.mime }
tof.write f.info.mime, (res) ->
me.log "INFO", __("Copied {0} -> {1}", f.path, to)
return e res.error if res.error
fn(l)
, "binary"
return fn files
compile: () ->
me = @
list = ("#{me.prjfile.cache.root}/#{v}" for v in me.prjfile.cache.coffees)
t = ""
@verify().then () ->
me.cat(list, t)
.then (code) ->
return new Promise (r, e) ->
try
jsrc = CoffeeScript.compile code
me.log "SUCCESS", __("Compiled successful")
r jsrc
catch ex
e ex
build: () ->
me = @
@log "clean"
@compile().then (r) ->
# cat to the javascript
list = ("#{me.prjfile.cache.root}/#{v}" for v in me.prjfile.cache.javascripts)
me.cat(list, r).then (jsrc) ->
return new Promise (r, e) ->
r jsrc
.then (jsrc) ->
# write javascript src to file
return new Promise (r, e) ->
fp = "#{me.prjfile.cache.root}/build/debug/main.js".asFileHandler()
fp.cache = jsrc
fp.write "text/plain", (res) ->
return e res.error if res.error
me.log "SUCCESS", __("Generated {0}", fp.path)
r()
.then () ->
# cat the css file
csslist = ("#{me.prjfile.cache.root}/#{v}" for v in me.prjfile.cache.css)
csstxt = ""
me.cat(csslist, csstxt).then (txt) ->
return new Promise (r, e) ->
return r() if txt is ""
fp = "#{me.prjfile.cache.root}/build/debug/main.css".asFileHandler()
fp.cache = txt
fp.write "text/plain", (d) ->
return e d.error if d.error
me.log "SUCCESS", __("Generated {0}", fp.path)
r()
.then () ->
# copy the remain files
copylist = ("#{me.prjfile.cache.root}/#{v}" for v in me.prjfile.cache.copies)
me.copy copylist, "#{me.prjfile.cache.root}/build/debug"
.then () ->
me.log "SUCCESS", __("Build done")
me.dirty = false
return new Promise (r, e) -> r()
run: () ->
me = @
fp = "#{me.prjfile.cache.root}/build/debug/package.json".asFileHandler()
fp.read (v) ->
me.log "INFO", __("Metadata found...")
v.text = v.name
v.path = "#{me.prjfile.cache.root}/build/debug"
v.filename = me.prjfile.cache.name
v.type = "app"
v.mime = "antos/app"
v.icon = "#{v.path}/#{v.icon}" if v.icon
v.iconclass = "fa fa-adn" unless v.iconclass or v.icon
me.log "INFO", __("Installing...")
me.systemsetting.system.packages[me.prjfile.cache.name] = v
# todo: auto matic refresh menu
me._gui.refreshSystemMenu()
#me._gui.buildSystemMenu()
me.log "INFO", __("Running {0}...", me.prjfile.cache.name)
me._gui.forceLaunch me.prjfile.cache.name
, "json"
bnR: () ->
@log "clean"
return @run() unless @dirty
me = @
@build().then () ->
me.run()
.catch (ex) ->
me.log "ERROR", ex.toString()
release: () ->
me = @
@log "INFO", __("Preparing for release")
new Promise (r, e) ->
me._api.require "jszip.min", () ->
fp = "#{me.prjfile.cache.root}/build/debug".asFileHandler()
fp.read (d) ->
return e d.error if d.error
r d.result
.then (files) ->
return new Promise (r, e) ->
zip = new JSZip()
fn = (list) ->
return r zip if list.length is 0
f = (list.splice 0, 1)[0].path.asFileHandler()
return fn list if f.type is "dir"
f.read (d) ->
zip.file f.basename, d, { binary: true }
me.log "INFO", __("add {0} to zip", f.basename)
fn list
, "binary"
fn files
.then (zip) ->
zip.generateAsync({type:"base64"}).then (data) ->
f = "#{me.prjfile.cache.root}/build/release/#{me.prjfile.cache.name}.zip".asFileHandler()
f.cache = 'data:application/zip;base64,' + data
f.write "base64", (r) ->
return me.log "ERROR", __("Cannot save the zip file {0} : {1}", f.path, r.error) if r.error
me.log "SUCCESS", __("zip file generated in release folder")
buildAndRelease: () ->
@log "clean"
return @release() unless @dirty
me = @
@build().then () ->
me.release()
.catch (ex) ->
me.log "ERROR", ex.toString()
AntOSDK.singleton = false
AntOSDK.dependencies = [
"ace/ace",
"ace/ext-language_tools",
"ace/ext-modelist",
"ace/ext-themelist"
]
this.OS.register "AntOSDK", AntOSDK

View File

@ -0,0 +1,121 @@
afx-app-window[data-id="antOSDK"] afx-list-view {
margin: 2px;
margin-right: 5px;
}
afx-app-window[data-id="antOSDK"] afx-list-view div.list-container{
z-index: 10;
}
afx-app-window[data-id="antOSDK"] afx-resizer{
z-index: 11;
background-color: transparent;
border-right: 1px solid #a6a6a6;
}
afx-app-window[data-id="antOSDK"] afx-resizer[data-id="botrz"]
{
z-index: 9;
border-top: 1px solid #a6a6a6;
background-color: #2f3129;
border-right: 0;
}
afx-app-window[data-id="antOSDK"] div.welcome-cnt {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
afx-app-window[data-id="antOSDK"] div.welcome-cnt afx-label.wmsg {
font-weight: bold;
color: #a6A6A6;
font-size: 20px;
}
afx-app-window[data-id="antOSDK"] div.welcome-cnt p{
text-align: center;
display: block;
width: 100%;
}
afx-app-window[data-id="antOSDK"] afx-label[data-id="editorstat"]{
padding-right:5px;
text-align: right;
display: inline-block;
}
afx-app-window[data-id="antOSDK"] .afx-window-content {
background-color: #f6F6F6;
}
afx-app-window[data-id="antOSDK"] div[data-id= "output"] {
background-color: #2f3129;
padding: 10px;
padding-left: 40px;
color:white;
overflow: auto;
}
afx-app-window[data-id="antOSDK"] div[data-id= "output"] p{
margin:0;
padding:0;
font-family: "HermitLight";
text-align: left;
}
afx-app-window[data-id="antOSDK"] div[data-id= "output"] p.error{
color: red;
}
afx-app-window[data-id="antOSDK"] div[data-id= "output"] p.warning{
color: orange;
}
afx-app-window[data-id="antOSDK"] div[data-id= "output"] p.success {
color: green;
}
afx-app-window[data-id="antOSDK"] afx-label.outputheader {
background-color: #2f3129;
font-weight: bold;
padding-left: 10px;
color:white;
}
afx-app-window[data-id="antOSDK"] afx-hbox[data-id="bottom-vbox"] {
background-color:#2f3129;
}
afx-app-window[data-id="antOSDK"] afx-hbox[data-id="bottom-vbox"] afx-button button{
background-color:#2f3129;
color:white;
border:0;
border-radius: 0;
}
afx-app-window[data-id="antOSDK"] afx-hbox[data-id="bottom-vbox"] afx-list-view > div.list-container > div {
background-color: #3c3c3c;
color:white;
border:0;
border-radius: 0;
}
afx-app-window[data-id="antOSDK"] afx-hbox[data-id="bottom-vbox"] afx-list-view > div.list-container > div::before{
color: white;
}
afx-tab-bar[data-id="tabarea"] afx-list-view > div.list-container > ul > li {
background-color: #dfdfdf;
color:#272822;
border: 0;
border-top: 1px solid #a6a6a6;
border-right: 1px solid #a6a6a6;
border-radius: 0;
}
afx-tab-bar[data-id="tabarea"] afx-list-view{
padding:0;
margin: 0;
border-left: 0;
border-bottom: 1px solid #a6a6a6;
}
/*afx-tab-bar[data-id="tabarea"] afx-list-view i.closable:before{
color: white;
}*/
afx-tab-bar[data-id="tabarea"] afx-list-view > div.list-container > ul > li.selected {
background-color: #f6F6F6;
border-radius: 0;
}
afx-app-window[data-id="BuildDialog"] afx-label.header {
font-weight: bold;
margin: 0;
}
afx-app-window[data-id="BuildDialog"] afx-list-view {
border: 1px solid #a6A6A6;
}

View File

@ -0,0 +1,15 @@
{
"app":"AntOSDK",
"name":"AntOS development kit",
"description":"Development tool for building AntOS application",
"info":{
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.0.5-a",
"category":"System",
"iconclass":"fa fa-cubes",
"mimes":[
"text/antos-project"
]
}

View File

@ -0,0 +1,19 @@
<afx-app-window apptitle="" width="600" height="500" data-id="antOSDK">
<afx-hbox >
<afx-file-view data-width = "155" min-width="155" data-id = "fileview" view='tree' status = false></afx-file-view>
<afx-resizer data-width = "3" ></afx-resizer>
<afx-vbox>
<afx-tab-bar data-id="tabarea" data-height="23" closable = true></afx-tab-bar>
<div data-id="datarea" data-height="80%"></div>
<afx-resizer data-height="3" data-id="botrz"></afx-resizer>
<afx-hbox data-height="30" data-id="bottom-vbox">
<afx-label class="outputheader" iconclass= "fa fa-wpforms" text = "__(Output)"></afx-label>
<afx-list-view data-width="160" data-id = "themelist" dropdown = "true" width="135"></afx-list-view>
<afx-list-view data-width="125" data-id = "modelist" dropdown = "true" width="100"></afx-list-view>
<afx-button data-id = "log-clear" data-width="25" iconclass="fa fa-trash"></afx-button>
</afx-hbox>
<div data-id= "output" ></div>
<afx-label data-id="editorstat" data-height="20"></afx-label>
</afx-vbox>
</afx-hbox>
</afx-app-window>

View File

@ -0,0 +1,15 @@
<afx-app-window apptitle="" width="600" height="500" data-id="antOSDK">
<afx-vbox>
<afx-hbox >
<div class = "welcome-cnt">
<afx-label text="__(Welcome to AntOSDK)" class="wmsg"></afx-label>
<p>
<afx-button data-id="btnnewprj" iconclass= "fa fa-plus-circle" text = "__(New project)"></afx-button>
<afx-button data-id="btnopenprj" iconclass = "fa fa-folder-open" text = "__(Open project)"></afx-button>
</p>
</div>
</afx-hbox>
<div data-id= "output" ></div>
</afx-vbox>
</afx-app-window>

View File

@ -1,10 +1,10 @@
coffee_files = dialogs.coffee main.coffee
jsfiles =
jsfiles = katex/katex.js katex/auto-render.js
cssfiles = main.css
cssfiles = main.css katex/katex.css
copyfiles = scheme.html cvsection.html package.json
copyfiles = scheme.html cvsection.html package.json katex/fonts api/sendmail.lua sendmail.html
PKG_NAME=Blogger

View File

@ -0,0 +1,17 @@
local data = ...
print(data.content)
for k,v in pairs(data.to) do
print("sent to:"..v)
local to = v
local from = "From: xsang.le@gmail.com\n"
local suject = "Subject: " .. data.title .. "\n"
local content = data.content.."\n"
local cmd = 'echo "' .. utils.escape(from .. suject .. content) .. '"| sendmail ' .. to
--print(cmd)
local r = os.execute(cmd)
if not r then
print("Cannot send mail to: "..v)
end
end
return "Email sent"

View File

@ -25,6 +25,7 @@
</div>
<afx-hbox data-height = "35">
<div></div>
<afx-switch data data-id = "section-publish" data-width="30"></afx-switch>
<afx-button iconclass = "fa fa-save" data-id = "bt-cv-sec-save" data-width="60" text = "__(Save)"/>
</afx-hbox>
</afx-vbox>

View File

@ -1,3 +1,20 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# 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 https://www.gnu.org/licenses/.
class BloggerCategoryDialog extends this.OS.GUI.BasicDialog
constructor: () ->
super "BloggerCategoryDialog", {
@ -43,9 +60,6 @@ class BloggerCategoryDialog extends this.OS.GUI.BasicDialog
(d.find "bt0").trigger() if e.which is 13
}
this.OS.register "BloggerCategoryDialog", BloggerCategoryDialog
# This dialog is use for cv section editing
class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
@ -70,6 +84,7 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
inputs = me.select "[input-class='user-input']"
(($ v).val me.data[v.name] for v in inputs ) if me.data
@editor.value me.data.content if me.data and me.data.content
(me.find "section-publish").set "swon", (if Number(me.data.publish) then true else false)
(@find "bt-cv-sec-save").set "onbtclick", (e) ->
data = {}
console.log inputs
@ -78,6 +93,11 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
return me.notify __("Title or content must not be blank") if data.title is "" and data.content is ""
#return me.notify "Content must not be blank" if data.content is ""
data.id = me.data.id if me.data and me.data.id
if (me.find "section-publish").get "swon"
data.publish = 1
else
data.publish = 0
me.handler data if me.handler
me.quit()
me.resizeContent()
@ -86,4 +106,71 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
children = ($ container).children()
cheight = ($ container).height() - 30
($ children[1]).css("height", cheight + "px")
this.OS.register "BloggerCVSectionDiaglog", BloggerCVSectionDiaglog
# this dialog is for send mail
class BloggerSendmailDiaglog extends this.OS.GUI.BaseDialog
constructor: () ->
super "BloggerCVSectionDiaglog"
init: () ->
@render "#{@path()}/sendmail.html"
@subdb = new @.parent._api.DB("subscribers")
main: () ->
# get db
me = @
@maillinglist = @find "email-list"
title = (new RegExp "^#+(.*)\n", "g").exec @data.content
(@find "mail-title").value = title[1]
content = (@data.content.substring 0, 500) + "..."
(@find "contentarea").value = BloggerSendmailDiaglog.template.format @data.id, content, @data.id
@subdb.find {}, (d) ->
return me.error __("Cannot fetch subscribers data: {0}", d.error) if d.error
for v in d.result
v.text = v.name
v.switch = true
v.checked = true
me.maillinglist.set "items", d.result
(@find "bt-sendmail").set "onbtclick", (e) ->
items = me.maillinglist.get "items"
emails = []
emails.push v.email for v in items when v.checked is true
return me.notify __("No email selected") if emails.length is 0
# send the email
data =
path: "#{me.parent.path()}/sendmail.lua",
parameters:
to: emails,
title: (me.find "mail-title").value,
content: (me.find "contentarea").value
me._api.post "system/apigateway", data, (d) ->
me.notify "Sendmail: {0}".format d
me.quit()
, (e, s) ->
console.log e
me.error __("Error sending mail: {0}", e.responseText)
BloggerSendmailDiaglog.template = """
Hello,
Xuan Sang LE has just published a new post on his blog: https://blog.lxsang.me/post/id/{0}
==========
{1}
==========
Read the full article via:
https://blog.lxsang.me/post/id/{2}
You receive this email because you have been subscribed to his blog.
Have a nice day,
Sent from Blogger, an AntOS application
"""

View File

@ -0,0 +1,790 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("katex"));
else if(typeof define === 'function' && define.amd)
define(["katex"], factory);
else if(typeof exports === 'object')
exports["renderMathInElement"] = factory(require("katex"));
else
root["renderMathInElement"] = factory(root["katex"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_38__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 9);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = function(it){
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(3)(function(){
return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = function(exec){
try {
return !!exec();
} catch(e){
return true;
}
};
/***/ }),
/* 4 */
/***/ (function(module, exports) {
var core = module.exports = {version: '2.4.0'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(6)
, defined = __webpack_require__(7);
module.exports = function(it){
return IObject(defined(it));
};
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(27);
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 7 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function(it){
if(it == undefined)throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 8 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil
, floor = Math.floor;
module.exports = function(it){
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_katex__ = __webpack_require__(38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_katex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_katex__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__splitAtDelimiters__ = __webpack_require__(39);
/* eslint no-console:0 */
var splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
var data = [{ type: "text", data: text }];
for (var i = 0; i < delimiters.length; i++) {
var delimiter = delimiters[i];
data = Object(__WEBPACK_IMPORTED_MODULE_2__splitAtDelimiters__["a" /* default */])(data, delimiter.left, delimiter.right, delimiter.display || false);
}
return data;
};
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
* API, we should copy it before mutating.
*/
var renderMathInText = function renderMathInText(text, optionsCopy) {
var data = splitWithDelimiters(text, optionsCopy.delimiters);
var fragment = document.createDocumentFragment();
for (var i = 0; i < data.length; i++) {
if (data[i].type === "text") {
fragment.appendChild(document.createTextNode(data[i].data));
} else {
var span = document.createElement("span");
var math = data[i].data;
// Override any display mode defined in the settings with that
// defined by the text itself
optionsCopy.displayMode = data[i].display;
try {
__WEBPACK_IMPORTED_MODULE_1_katex___default.a.render(math, span, optionsCopy);
} catch (e) {
if (!(e instanceof __WEBPACK_IMPORTED_MODULE_1_katex___default.a.ParseError)) {
throw e;
}
optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
fragment.appendChild(document.createTextNode(data[i].rawData));
continue;
}
fragment.appendChild(span);
}
}
return fragment;
};
var renderElem = function renderElem(elem, optionsCopy) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
if (childNode.nodeType === 3) {
// Text node
var frag = renderMathInText(childNode.textContent, optionsCopy);
i += frag.childNodes.length - 1;
elem.replaceChild(frag, childNode);
} else if (childNode.nodeType === 1) {
// Element node
var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1;
if (shouldRender) {
renderElem(childNode, optionsCopy);
}
}
// Otherwise, it's something else, and ignore it.
}
};
var defaultAutoRenderOptions = {
delimiters: [{ left: "$$", right: "$$", display: true }, { left: "\\[", right: "\\]", display: true }, { left: "\\(", right: "\\)", display: false }],
ignoredTags: ["script", "noscript", "style", "textarea", "pre", "code"],
errorCallback: function errorCallback(msg, err) {
console.error(msg, err);
}
};
var renderMathInElement = function renderMathInElement(elem, options) {
if (!elem) {
throw new Error("No element provided to render");
}
var optionsCopy = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default()({}, defaultAutoRenderOptions, options);
renderElem(elem, optionsCopy);
};
/* harmony default export */ __webpack_exports__["default"] = (renderMathInElement);
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(11), __esModule: true };
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(12);
module.exports = __webpack_require__(4).Object.assign;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(13);
$export($export.S + $export.F, 'Object', {assign: __webpack_require__(23)});
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(0)
, core = __webpack_require__(4)
, ctx = __webpack_require__(14)
, hide = __webpack_require__(16)
, PROTOTYPE = 'prototype';
var $export = function(type, name, source){
var IS_FORCED = type & $export.F
, IS_GLOBAL = type & $export.G
, IS_STATIC = type & $export.S
, IS_PROTO = type & $export.P
, IS_BIND = type & $export.B
, IS_WRAP = type & $export.W
, exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
, expProto = exports[PROTOTYPE]
, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
, key, own, out;
if(IS_GLOBAL)source = name;
for(key in source){
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if(own && key in exports)continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function(C){
var F = function(a, b, c){
if(this instanceof C){
switch(arguments.length){
case 0: return new C;
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if(IS_PROTO){
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(15);
module.exports = function(fn, that, length){
aFunction(fn);
if(that === undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
};
case 2: return function(a, b){
return fn.call(that, a, b);
};
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
};
}
return function(/* ...args */){
return fn.apply(that, arguments);
};
};
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports = function(it){
if(typeof it != 'function')throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(17)
, createDesc = __webpack_require__(22);
module.exports = __webpack_require__(2) ? function(object, key, value){
return dP.f(object, key, createDesc(1, value));
} : function(object, key, value){
object[key] = value;
return object;
};
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(18)
, IE8_DOM_DEFINE = __webpack_require__(19)
, toPrimitive = __webpack_require__(21)
, dP = Object.defineProperty;
exports.f = __webpack_require__(2) ? Object.defineProperty : function defineProperty(O, P, Attributes){
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if(IE8_DOM_DEFINE)try {
return dP(O, P, Attributes);
} catch(e){ /* empty */ }
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
if('value' in Attributes)O[P] = Attributes.value;
return O;
};
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(1);
module.exports = function(it){
if(!isObject(it))throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(2) && !__webpack_require__(3)(function(){
return Object.defineProperty(__webpack_require__(20)('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(1)
, document = __webpack_require__(0).document
// in old IE typeof document.createElement is 'object'
, is = isObject(document) && isObject(document.createElement);
module.exports = function(it){
return is ? document.createElement(it) : {};
};
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(1);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function(it, S){
if(!isObject(it))return it;
var fn, val;
if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 22 */
/***/ (function(module, exports) {
module.exports = function(bitmap, value){
return {
enumerable : !(bitmap & 1),
configurable: !(bitmap & 2),
writable : !(bitmap & 4),
value : value
};
};
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__(24)
, gOPS = __webpack_require__(35)
, pIE = __webpack_require__(36)
, toObject = __webpack_require__(37)
, IObject = __webpack_require__(6)
, $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(3)(function(){
var A = {}
, B = {}
, S = Symbol()
, K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function(k){ B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source){ // eslint-disable-line no-unused-vars
var T = toObject(target)
, aLen = arguments.length
, index = 1
, getSymbols = gOPS.f
, isEnum = pIE.f;
while(aLen > index){
var S = IObject(arguments[index++])
, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
, length = keys.length
, j = 0
, key;
while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(25)
, enumBugKeys = __webpack_require__(34);
module.exports = Object.keys || function keys(O){
return $keys(O, enumBugKeys);
};
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(26)
, toIObject = __webpack_require__(5)
, arrayIndexOf = __webpack_require__(28)(false)
, IE_PROTO = __webpack_require__(31)('IE_PROTO');
module.exports = function(object, names){
var O = toIObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(names.length > i)if(has(O, key = names[i++])){
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 26 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function(it, key){
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 27 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function(it){
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(5)
, toLength = __webpack_require__(29)
, toIndex = __webpack_require__(30);
module.exports = function(IS_INCLUDES){
return function($this, el, fromIndex){
var O = toIObject($this)
, length = toLength(O.length)
, index = toIndex(fromIndex, length)
, value;
// Array#includes uses SameValueZero equality algorithm
if(IS_INCLUDES && el != el)while(length > index){
value = O[index++];
if(value != value)return true;
// Array#toIndex ignores holes, Array#includes - not
} else for(;length > index; index++)if(IS_INCLUDES || index in O){
if(O[index] === el)return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(8)
, min = Math.min;
module.exports = function(it){
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(8)
, max = Math.max
, min = Math.min;
module.exports = function(index, length){
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(32)('keys')
, uid = __webpack_require__(33);
module.exports = function(key){
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(0)
, SHARED = '__core-js_shared__'
, store = global[SHARED] || (global[SHARED] = {});
module.exports = function(key){
return store[key] || (store[key] = {});
};
/***/ }),
/* 33 */
/***/ (function(module, exports) {
var id = 0
, px = Math.random();
module.exports = function(key){
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 34 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 35 */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/* 36 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(7);
module.exports = function(it){
return Object(defined(it));
};
/***/ }),
/* 38 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_38__;
/***/ }),
/* 39 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* eslint no-constant-condition:0 */
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
// Adapted from
// https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
var index = startIndex;
var braceLevel = 0;
var delimLength = delimiter.length;
while (index < text.length) {
var character = text[index];
if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
return index;
} else if (character === "\\") {
index++;
} else if (character === "{") {
braceLevel++;
} else if (character === "}") {
braceLevel--;
}
index++;
}
return -1;
};
var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
var finalData = [];
for (var i = 0; i < startData.length; i++) {
if (startData[i].type === "text") {
var text = startData[i].data;
var lookingForLeft = true;
var currIndex = 0;
var nextIndex = void 0;
nextIndex = text.indexOf(leftDelim);
if (nextIndex !== -1) {
currIndex = nextIndex;
finalData.push({
type: "text",
data: text.slice(0, currIndex)
});
lookingForLeft = false;
}
while (true) {
if (lookingForLeft) {
nextIndex = text.indexOf(leftDelim, currIndex);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "text",
data: text.slice(currIndex, nextIndex)
});
currIndex = nextIndex;
} else {
nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
if (nextIndex === -1) {
break;
}
finalData.push({
type: "math",
data: text.slice(currIndex + leftDelim.length, nextIndex),
rawData: text.slice(currIndex, nextIndex + rightDelim.length),
display: display
});
currIndex = nextIndex + rightDelim.length;
}
lookingForLeft = !lookingForLeft;
}
finalData.push({
type: "text",
data: text.slice(currIndex)
});
} else {
finalData.push(startData[i]);
}
}
return finalData;
};
/* harmony default export */ __webpack_exports__["a"] = (splitAtDelimiters);
/***/ })
/******/ ])["default"];
});

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More