60 Commits

Author SHA1 Message Date
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
94 changed files with 71484 additions and 178 deletions

9
.travis.yml Normal file
View File

@ -0,0 +1,9 @@
language: javascript
install:
- npm install -g coffeescript@1.9.3
- npm install -g uglify-js
- npm install -g uglifycss
- npm install -g riot
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

@ -4,6 +4,13 @@ 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,6 +107,13 @@ 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 ../../ && (mkdir repo/$$PKG || true) && mv packages/$$PKG/"$$PKG.zip" repo/$$PKG && touch repo/$$PKG/$$PKG.md && rm -r packages/$$PKG
uglify:
# uglify antos.js
@ -106,21 +123,22 @@ uglify:
# npm install riot -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,11 +1,14 @@
# antOS
[![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 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.
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")
@ -24,10 +27,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/>.

3
TODO
View File

@ -1,3 +1,2 @@
# add version number
# SDK for application development right on the OS
# bug tracking app
# packages manager (restricted mode)

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,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 BaseApplication extends this.OS.GUI.BaseModel
constructor: (name, args) ->
super name, args
@ -8,13 +25,14 @@ class BaseApplication extends this.OS.GUI.BaseModel
CTRL: {}
SHIFT: {}
META: {}
me = @
@subscribe "appregistry", ( m ) ->
me.applySetting m.data.m if (m.name is me.name)
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 +48,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
@ -65,7 +87,10 @@ class BaseApplication extends this.OS.GUI.BaseModel
toggle: () ->
@trigger "toggle"
title: () ->
@scheme.get "apptitle"
onexit: (evt) ->
@cleanup(evt)
if not evt.prevent

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
@ -183,7 +200,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 +290,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 = @
@ -14,10 +32,11 @@ class BaseModel
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 @
@ -34,7 +53,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 +80,14 @@ 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 } }
_courrier.trigger t, { id: @pid, name: @name, data: { m: m, icon: mt.icon, iconclass: mt.iconclass }, error: e }
notify: (m) ->
@publish "notification", m
@ -70,7 +96,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

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

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) ->

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 }
@ -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
@ -19,9 +37,11 @@ self.OS.GUI =
]
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 +104,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 +132,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
@ -152,6 +176,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 +191,11 @@ 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()
toggleFullscreen: () ->
el = ($ "body")[0]
@ -219,9 +244,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 +303,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"
@ -376,7 +430,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,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.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"

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

@ -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,16 @@
"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

@ -246,6 +246,21 @@
"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}"
}

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

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).parent().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

@ -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

@ -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,106 @@
<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)
})
})
}
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

@ -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>

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,746 @@
# 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
me.fileview.set "preventUpdate", true
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.1a",
"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="" 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 (d) ->
me.log "INFO", __("Opening {0}", me.prjfile.path)
me.tabarea.set "selected", -1
me.tabarea.set "items", []
me.currfile = "#{d.root}/README.md".asFileHandler()
me.currfile.dirty = false
me.chdir d.root if d.root
me.prjfile.cache = d
me.log "INFO", __("Opening {0}", me.currfile.path)
me.open me.currfile
,"json"
else
me.init()
open: (file) ->
#find table
i = @findTabByFile file
@fileview.set "preventUpdate", true
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
@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.1-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,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
@ -85,5 +99,4 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
container = @find "editor-container"
children = ($ container).children()
cheight = ($ container).height() - 30
($ children[1]).css("height", cheight + "px")
this.OS.register "BloggerCVSectionDiaglog", BloggerCVSectionDiaglog
($ children[1]).css("height", cheight + "px")

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 Blogger extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "Blogger", args
@ -35,7 +52,7 @@ class Blogger extends this.OS.GUI.BaseApplication
me.saveUser()
(@find "cv-cat-add").set "onbtclick", (e) ->
me.openDialog "BloggerCategoryDialog",
me.openDialog new BloggerCategoryDialog(),
(d) ->
c =
name: d.value,
@ -51,7 +68,7 @@ class Blogger extends this.OS.GUI.BaseApplication
(@find "cv-cat-edit").set "onbtclick", (e) ->
cat = me.cvlist.get "selectedItem"
return unless cat
me.openDialog "BloggerCategoryDialog", (d) ->
me.openDialog new BloggerCategoryDialog(), (d) ->
c =
id: cat.id,
publish: cat.publish,
@ -76,7 +93,7 @@ class Blogger extends this.OS.GUI.BaseApplication
(@find "cv-sec-add").set "onbtclick", (e) ->
cat = me.cvlist.get "selectedItem"
return me.notify __("Please select a category") unless cat and cat.id isnt 0
me.openDialog "BloggerCVSectionDiaglog", (d) ->
me.openDialog new BloggerCVSectionDiaglog(), (d) ->
d.cid = Number cat.id
d.start = Number d.start
d.end = Number d.end
@ -91,7 +108,7 @@ class Blogger extends this.OS.GUI.BaseApplication
sec = (me.find "cv-sec-list").get "selected"
return me.notify __("Please select a section to move") unless sec
me.openDialog "BloggerCategoryDialog", (d) ->
me.openDialog new BloggerCategoryDialog(), (d) ->
c =
id: sec.id,
cid: d.p.id
@ -106,7 +123,7 @@ class Blogger extends this.OS.GUI.BaseApplication
sec = (me.find "cv-sec-list").get "selected"
return me.notify __("Please select a section to edit") unless sec
me.openDialog "BloggerCVSectionDiaglog", (d) ->
me.openDialog new BloggerCVSectionDiaglog(), (d) ->
d.cid = Number sec.cid
d.start = Number d.start
d.end = Number d.end

View File

@ -62,6 +62,9 @@ afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] >
background-color: transparent;
border-radius: 5px;
}
afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] > div.list-container > ul > li.selected ul.complex-content li{
color: #414339;
}
afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .cv-content{
text-align: justify;
}

View File

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

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 CodeBlock extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "CodeBlock", args

View File

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

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 Calendar extends this.OS.GUI.BaseService
constructor: (args) ->
super "Calendar", args

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 PushNotification extends this.OS.GUI.BaseService
constructor: (args) ->
super "PushNotification", args

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 SpotlightDialog extends this.OS.GUI.BaseDialog
constructor: () ->
super "SpotlightDialog"

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 UserService extends this.OS.GUI.BaseService
constructor: (args) ->
super "UserService", args

View File

@ -7,9 +7,9 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com",
"credit": "dedicated to some one here",
"licences": "MIT"
"licences": "GPLv3"
},
"version":"0.1a",
"version":"0.0.1-a",
"category":"System",
"mimes":["*"]
}

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/.
_GUI = this.OS.GUI
class DummyApp extends this.OS.GUI.BaseApplication
constructor: (args) ->
@ -48,6 +66,8 @@ class DummyApp extends this.OS.GUI.BaseApplication
}
]
}
(@find "sw").set "onchange", (e) ->
console.log e, ((self.find "sw").get "swon")
tree.set "data",tdata
list = @find "mylist"
@ -86,7 +106,9 @@ class DummyApp extends this.OS.GUI.BaseApplication
{text:"file2.cpp"}
]
tabs.set "items", tabdatas
(@find "slider").set "max", 200
(@find "slider").set "onchange", (d) ->
console.log d
@scheme.set "apptitle", "AntOS feature showcase"
@scheme.contextmenuHandler = (e, m) ->

View File

@ -6,9 +6,9 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com",
"credit": "dedicated to some one here",
"licences": "MIT"
"licences": "GPLv3"
},
"version":"0.1a",
"version":"0.0.2-a",
"category":"System",
"icon": "icon.png",
"mimes":["none"]

View File

@ -4,11 +4,13 @@
<afx-vbox>
<afx-tab-bar data-height = "50" data-id="mytabs" closable = true></afx-tab-bar>
<afx-tree-view data-id="mytree"> </afx-tree-view>
<afx-slider data-id="slider" data-height="20" value="30"></afx-slider>
<div data-height="10"></div>
</afx-vbox>
<afx-resizer data-width = "5" ></afx-resizer>
<afx-vbox>
<afx-button data-height="30" text="__(Read more)" iconclass="fa fa-camera-retro fa-lg" id="button"></afx-button>
<afx-switch enable= true data-height="30"></afx-switch>
<afx-switch data-id="sw" enable= true data-height="30"></afx-switch>
<afx-calendar-view></afx-calendar-view>
<afx-resizer data-height = "5" ></afx-resizer>
<afx-color-picker></afx-color-picker>

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 Files extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "Files", args
@ -224,7 +242,7 @@ class Files extends this.OS.GUI.BaseApplication
@notify __("File {0} cut", file.filename)
when "#{@name}-copy"
return unless file
return unless file or file.type is "dir"
@clipboard =
cut: false
file: file.path.asFileHandler()
@ -239,8 +257,14 @@ class Files extends this.OS.GUI.BaseApplication
me.clipboard = undefined
me.error __("Fail to paste: {0}", r.error) if r.error
else
@notify __("Copy not yet implemented")
@clipboard = undefined
@clipboard.file.read (d) ->
blob = new Blob [d], { type: me.clipboard.file.info.mime }
fp = "#{me.currdir.path}/#{me.clipboard.file.basename}".asFileHandler()
fp.cache = blob
fp.write me.clipboard.file.info.mime, (r) ->
me.clipboard = undefined
me.error __("Fail to paste: {0}", r.error) if r.error
, "binary"
else
@_api.handler.setting()
@ -271,7 +295,7 @@ class Files extends this.OS.GUI.BaseApplication
when "#{@name}-upload"
me = @
@currdir.upload (r) ->
me.error __("Fail to upload to {0}: {1}", d, r.error) if r.error
me.error __("Fail to upload to {0}: {1}", me.currdir.path, r.error) if r.error
when "#{@name}-share"
me = @

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-hdd-o",
"mimes":["dir"]

View File

@ -0,0 +1,10 @@
coffee_files = main.coffee
jsfiles = libs/svg-pan-zoom.js libs/mermaidAPI.js
cssfiles = main.css
copyfiles = scheme.html package.json
PKG_NAME=GraphEditor
include ../pkg.mk

View File

@ -0,0 +1,273 @@
/* Flowchart variables */
/* Sequence Diagram variables */
/* Gantt chart variables */
afx-app-window[data-id="graph_editor_win"] .mermaid .label {
color: #333;
}
afx-app-window[data-id="graph_editor_win"] .node rect,
afx-app-window[data-id="graph_editor_win"] .node circle,
afx-app-window[data-id="graph_editor_win"] .node ellipse,
afx-app-window[data-id="graph_editor_win"] .node polygon {
fill: #ECECFF;
stroke: #CCCCFF;
stroke-width: 1px;
}
afx-app-window[data-id="graph_editor_win"] .edgePath .path {
stroke: #333333;
}
afx-app-window[data-id="graph_editor_win"] .edgeLabel {
background-color: #e8e8e8;
}
afx-app-window[data-id="graph_editor_win"] .cluster rect {
fill: #ffffde !important;
rx: 4 !important;
stroke: #aaaa33 !important;
stroke-width: 1px !important;
}
afx-app-window[data-id="graph_editor_win"] .cluster text {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .actor {
stroke: #CCCCFF;
fill: #ECECFF;
}
afx-app-window[data-id="graph_editor_win"] text.actor {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .actor-line {
stroke: grey;
}
afx-app-window[data-id="graph_editor_win"] .messageLine0 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #333;
}
afx-app-window[data-id="graph_editor_win"] .messageLine1 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
stroke: #333;
}
afx-app-window[data-id="graph_editor_win"] #arrowhead {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] #crosshead path {
fill: #333 !important;
stroke: #333 !important;
}
afx-app-window[data-id="graph_editor_win"] .messageText {
fill: #333;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .labelBox {
stroke: #CCCCFF;
fill: #ECECFF;
}
afx-app-window[data-id="graph_editor_win"] .labelText {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .loopText {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .loopLine {
stroke-width: 2;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #CCCCFF;
}
afx-app-window[data-id="graph_editor_win"] .note {
stroke: #aaaa33;
fill: #fff5ad;
}
afx-app-window[data-id="graph_editor_win"] .noteText {
fill: black;
stroke: none;
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
/** Section styling */
afx-app-window[data-id="graph_editor_win"] .section {
stroke: none;
opacity: 0.2;
}
afx-app-window[data-id="graph_editor_win"] .section0 {
fill: rgba(102, 102, 255, 0.49);
}
afx-app-window[data-id="graph_editor_win"] .section2 {
fill: #fff400;
}
afx-app-window[data-id="graph_editor_win"] .section1,
afx-app-window[data-id="graph_editor_win"] .section3 {
fill: white;
opacity: 0.2;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle0 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle1 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle2 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle3 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle {
text-anchor: start;
font-size: 11px;
text-height: 14px;
}
/* Grid and axis */
afx-app-window[data-id="graph_editor_win"] .grid .tick {
stroke: lightgrey;
opacity: 0.3;
shape-rendering: crispEdges;
}
afx-app-window[data-id="graph_editor_win"] .grid path {
stroke-width: 0;
}
/* Today line */
afx-app-window[data-id="graph_editor_win"] .today {
fill: none;
stroke: red;
stroke-width: 2px;
}
/* Task styling */
/* Default task */
afx-app-window[data-id="graph_editor_win"] .task {
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .taskText {
text-anchor: middle;
font-size: 11px;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutsideRight {
fill: black;
text-anchor: start;
font-size: 11px;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutsideLeft {
fill: black;
text-anchor: end;
font-size: 11px;
}
/* Specific task settings for the sections*/
afx-app-window[data-id="graph_editor_win"] .taskText0,
afx-app-window[data-id="graph_editor_win"] .taskText1,
afx-app-window[data-id="graph_editor_win"] .taskText2,
afx-app-window[data-id="graph_editor_win"] .taskText3 {
fill: white;
}
afx-app-window[data-id="graph_editor_win"] .task0,
afx-app-window[data-id="graph_editor_win"] .task1,
afx-app-window[data-id="graph_editor_win"] .task2,
afx-app-window[data-id="graph_editor_win"] .task3 {
fill: #8a90dd;
stroke: #534fbc;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutside0,
afx-app-window[data-id="graph_editor_win"] .taskTextOutside2 {
fill: black;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutside1,
afx-app-window[data-id="graph_editor_win"] .taskTextOutside3 {
fill: black;
}
/* Active task */
afx-app-window[data-id="graph_editor_win"] .active0,
afx-app-window[data-id="graph_editor_win"] .active1,
afx-app-window[data-id="graph_editor_win"] .active2,
afx-app-window[data-id="graph_editor_win"] .active3 {
fill: #bfc7ff;
stroke: #534fbc;
}
afx-app-window[data-id="graph_editor_win"] .activeText0,
afx-app-window[data-id="graph_editor_win"] .activeText1,
afx-app-window[data-id="graph_editor_win"] .activeText2,
afx-app-window[data-id="graph_editor_win"] .activeText3 {
fill: black !important;
}
/* Completed task */
afx-app-window[data-id="graph_editor_win"] .done0,
afx-app-window[data-id="graph_editor_win"] .done1,
afx-app-window[data-id="graph_editor_win"] .done2,
afx-app-window[data-id="graph_editor_win"] .done3 {
stroke: grey;
fill: lightgrey;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .doneText0,
afx-app-window[data-id="graph_editor_win"] .doneText1,
afx-app-window[data-id="graph_editor_win"] .doneText2,
afx-app-window[data-id="graph_editor_win"] .doneText3 {
fill: black !important;
}
/* Tasks on the critical line */
afx-app-window[data-id="graph_editor_win"] .crit0,
afx-app-window[data-id="graph_editor_win"] .crit1,
afx-app-window[data-id="graph_editor_win"] .crit2,
afx-app-window[data-id="graph_editor_win"] .crit3 {
stroke: #ff8888;
fill: red;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .activeCrit0,
afx-app-window[data-id="graph_editor_win"] .activeCrit1,
afx-app-window[data-id="graph_editor_win"] .activeCrit2,
afx-app-window[data-id="graph_editor_win"] .activeCrit3 {
stroke: #ff8888;
fill: #bfc7ff;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .doneCrit0,
afx-app-window[data-id="graph_editor_win"] .doneCrit1,
afx-app-window[data-id="graph_editor_win"] .doneCrit2,
afx-app-window[data-id="graph_editor_win"] .doneCrit3 {
stroke: #ff8888;
fill: lightgrey;
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
afx-app-window[data-id="graph_editor_win"] .doneCritText0,
afx-app-window[data-id="graph_editor_win"] .doneCritText1,
afx-app-window[data-id="graph_editor_win"] .doneCritText2,
afx-app-window[data-id="graph_editor_win"] .doneCritText3 {
fill: black !important;
}
afx-app-window[data-id="graph_editor_win"] .activeCritText0,
afx-app-window[data-id="graph_editor_win"] .activeCritText1,
afx-app-window[data-id="graph_editor_win"] .activeCritText2,
afx-app-window[data-id="graph_editor_win"] .activeCritText3 {
fill: black !important;
}
afx-app-window[data-id="graph_editor_win"] .titleText {
text-anchor: middle;
font-size: 18px;
fill: black;
}
/*
*/
afx-app-window[data-id="graph_editor_win"] .node text {
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
afx-app-window[data-id="graph_editor_win"] div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: 'trebuchet ms', verdana, arial;
font-size: 12px;
background: #ffffde;
border: 1px solid #aaaa33;
border-radius: 2px;
pointer-events: none;
z-index: 100;
}

View File

@ -0,0 +1,353 @@
/* Flowchart variables */
/* Sequence Diagram variables */
/* Gantt chart variables */
afx-app-window[data-id="graph_editor_win"] .mermaid .label {
font-family: 'trebuchet ms', verdana, arial;
color: #333;
}
afx-app-window[data-id="graph_editor_win"] .node rect,
afx-app-window[data-id="graph_editor_win"] .node circle,
afx-app-window[data-id="graph_editor_win"] .node ellipse,
afx-app-window[data-id="graph_editor_win"] .node polygon {
fill: #cde498;
stroke: #13540c;
stroke-width: 1px;
}
afx-app-window[data-id="graph_editor_win"] .edgePath .path {
stroke: green;
stroke-width: 1.5px;
}
afx-app-window[data-id="graph_editor_win"] .edgeLabel {
background-color: #e8e8e8;
}
afx-app-window[data-id="graph_editor_win"] .cluster rect {
fill: #cdffb2 !important;
rx: 4 !important;
stroke: #6eaa49 !important;
stroke-width: 1px !important;
}
afx-app-window[data-id="graph_editor_win"] .cluster text {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .actor {
stroke: #13540c;
fill: #cde498;
}
afx-app-window[data-id="graph_editor_win"] text.actor {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .actor-line {
stroke: grey;
}
afx-app-window[data-id="graph_editor_win"] .messageLine0 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #333;
}
afx-app-window[data-id="graph_editor_win"] .messageLine1 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
stroke: #333;
}
afx-app-window[data-id="graph_editor_win"] #arrowhead {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] #crosshead path {
fill: #333 !important;
stroke: #333 !important;
}
afx-app-window[data-id="graph_editor_win"] .messageText {
fill: #333;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .labelBox {
stroke: #326932;
fill: #cde498;
}
afx-app-window[data-id="graph_editor_win"] .labelText {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .loopText {
fill: black;
stroke: none;
}
afx-app-window[data-id="graph_editor_win"] .loopLine {
stroke-width: 2;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #326932;
}
afx-app-window[data-id="graph_editor_win"] .note {
stroke: #6eaa49;
fill: #fff5ad;
}
afx-app-window[data-id="graph_editor_win"] .noteText {
fill: black;
stroke: none;
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
/** Section styling */
afx-app-window[data-id="graph_editor_win"] .section {
stroke: none;
opacity: 0.2;
}
afx-app-window[data-id="graph_editor_win"] .section0 {
fill: #6eaa49;
}
afx-app-window[data-id="graph_editor_win"] .section2 {
fill: #6eaa49;
}
afx-app-window[data-id="graph_editor_win"] .section1,
afx-app-window[data-id="graph_editor_win"] .section3 {
fill: white;
opacity: 0.2;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle0 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle1 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle2 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle3 {
fill: #333;
}
afx-app-window[data-id="graph_editor_win"] .sectionTitle {
text-anchor: start;
font-size: 11px;
text-height: 14px;
}
/* Grid and axis */
afx-app-window[data-id="graph_editor_win"] .grid .tick {
stroke: lightgrey;
opacity: 0.3;
shape-rendering: crispEdges;
}
afx-app-window[data-id="graph_editor_win"] .grid path {
stroke-width: 0;
}
/* Today line */
afx-app-window[data-id="graph_editor_win"] .today {
fill: none;
stroke: red;
stroke-width: 2px;
}
/* Task styling */
/* Default task */
afx-app-window[data-id="graph_editor_win"] .task {
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .taskText {
text-anchor: middle;
font-size: 11px;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutsideRight {
fill: black;
text-anchor: start;
font-size: 11px;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutsideLeft {
fill: black;
text-anchor: end;
font-size: 11px;
}
/* Specific task settings for the sections*/
afx-app-window[data-id="graph_editor_win"] .taskText0,
afx-app-window[data-id="graph_editor_win"] .taskText1,
afx-app-window[data-id="graph_editor_win"] .taskText2,
afx-app-window[data-id="graph_editor_win"] .taskText3 {
fill: white;
}
afx-app-window[data-id="graph_editor_win"] .task0,
afx-app-window[data-id="graph_editor_win"] .task1,
afx-app-window[data-id="graph_editor_win"] .task2,
afx-app-window[data-id="graph_editor_win"] .task3 {
fill: #487e3a;
stroke: #13540c;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutside0,
afx-app-window[data-id="graph_editor_win"] .taskTextOutside2 {
fill: black;
}
afx-app-window[data-id="graph_editor_win"] .taskTextOutside1,
afx-app-window[data-id="graph_editor_win"] .taskTextOutside3 {
fill: black;
}
/* Active task */
afx-app-window[data-id="graph_editor_win"] .active0,
afx-app-window[data-id="graph_editor_win"] .active1,
afx-app-window[data-id="graph_editor_win"] .active2,
afx-app-window[data-id="graph_editor_win"] .active3 {
fill: #cde498;
stroke: #13540c;
}
afx-app-window[data-id="graph_editor_win"] .activeText0,
afx-app-window[data-id="graph_editor_win"] .activeText1,
afx-app-window[data-id="graph_editor_win"] .activeText2,
afx-app-window[data-id="graph_editor_win"] .activeText3 {
fill: black !important;
}
/* Completed task */
afx-app-window[data-id="graph_editor_win"] .done0,
afx-app-window[data-id="graph_editor_win"] .done1,
afx-app-window[data-id="graph_editor_win"] .done2,
afx-app-window[data-id="graph_editor_win"] .done3 {
stroke: grey;
fill: lightgrey;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .doneText0,
afx-app-window[data-id="graph_editor_win"] .doneText1,
afx-app-window[data-id="graph_editor_win"] .doneText2,
afx-app-window[data-id="graph_editor_win"] .doneText3 {
fill: black !important;
}
/* Tasks on the critical line */
afx-app-window[data-id="graph_editor_win"] .crit0,
afx-app-window[data-id="graph_editor_win"] .crit1,
afx-app-window[data-id="graph_editor_win"] .crit2,
afx-app-window[data-id="graph_editor_win"] .crit3 {
stroke: #ff8888;
fill: red;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .activeCrit0,
afx-app-window[data-id="graph_editor_win"] .activeCrit1,
afx-app-window[data-id="graph_editor_win"] .activeCrit2,
afx-app-window[data-id="graph_editor_win"] .activeCrit3 {
stroke: #ff8888;
fill: #cde498;
stroke-width: 2;
}
afx-app-window[data-id="graph_editor_win"] .doneCrit0,
afx-app-window[data-id="graph_editor_win"] .doneCrit1,
afx-app-window[data-id="graph_editor_win"] .doneCrit2,
afx-app-window[data-id="graph_editor_win"] .doneCrit3 {
stroke: #ff8888;
fill: lightgrey;
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
afx-app-window[data-id="graph_editor_win"] .doneCritText0,
afx-app-window[data-id="graph_editor_win"] .doneCritText1,
afx-app-window[data-id="graph_editor_win"] .doneCritText2,
afx-app-window[data-id="graph_editor_win"] .doneCritText3 {
fill: black !important;
}
afx-app-window[data-id="graph_editor_win"] .activeCritText0,
afx-app-window[data-id="graph_editor_win"] .activeCritText1,
afx-app-window[data-id="graph_editor_win"] .activeCritText2,
afx-app-window[data-id="graph_editor_win"] .activeCritText3 {
fill: black !important;
}
afx-app-window[data-id="graph_editor_win"] .titleText {
text-anchor: middle;
font-size: 18px;
fill: black;
}
/*
*/
afx-app-window[data-id="graph_editor_win"] g.classGroup text {
fill: #13540c;
stroke: none;
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
afx-app-window[data-id="graph_editor_win"] g.classGroup rect {
fill: #cde498;
stroke: #13540c;
}
afx-app-window[data-id="graph_editor_win"] g.classGroup line {
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] svg .classLabel .box {
stroke: none;
stroke-width: 0;
fill: #cde498;
opacity: 0.5;
}
afx-app-window[data-id="graph_editor_win"] svg .classLabel .label {
fill: #13540c;
}
afx-app-window[data-id="graph_editor_win"] .relation {
stroke: #13540c;
stroke-width: 1;
fill: none;
}
afx-app-window[data-id="graph_editor_win"] .composition {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #compositionStart {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #compositionEnd {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] .aggregation {
fill: #cde498;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #aggregationStart {
fill: #cde498;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #aggregationEnd {
fill: #cde498;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #dependencyStart {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #dependencyEnd {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #extensionStart {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] #extensionEnd {
fill: #13540c;
stroke: #13540c;
stroke-width: 1;
}
afx-app-window[data-id="graph_editor_win"] .node text {
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
afx-app-window[data-id="graph_editor_win"] div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: 'trebuchet ms', verdana, arial;
font-size: 12px;
background: #cdffb2;
border: 1px solid #6eaa49;
border-radius: 2px;
pointer-events: none;
z-index: 100;
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,252 @@
# 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 GraphEditor extends this.OS.GUI.BaseApplication
constructor: ( args ) ->
super "GraphEditor", args
main: () ->
me = @
#mermaid.initialize { startOnLoad: false }
mermaid.initialize {
theme: 'forest'
}
@currfile = if @args and @args.length > 0 then @args[0].asFileHandler() else "Untitled".asFileHandler()
@currfile.dirty = false
@datarea = @find "datarea"
@preview = @find "preview"
@btctn = @find "btn-container"
@.editor = ace.edit @datarea
@.editor.setOptions {
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
fontSize: "10pt"
}
#@.editor.completers.push { getCompletions: ( editor, session, pos, prefix, callback ) -> }
@editor.getSession().setUseWrapMode true
@editor.session.setMode "ace/mode/text"
@editor.setTheme "ace/theme/monokai"
@editor.on "input", () ->
if me.editormux
me.editormux = false
return false
if not me.currfile.dirty
me.currfile.dirty = true
if not me.currfile.basename
me.editormux = true
me.editor.setValue GraphEditor.dummymermaid
me.renderSVG false
@editor.container.addEventListener "keydown", (e) ->
me.renderSVG true if e.keyCode is 13
, true
@bindKey "CTRL-R", () -> me.renderSVG false
@bindKey "ALT-G", () -> me.export "SVG"
@bindKey "ALT-P", () -> me.export "PNG"
@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-M", () -> me.svgToCanvas(()->)
@on "hboxchange", () ->
me.editor.resize()
me.calibrate()
@on "focus", () -> me.editor.focus()
(@find "btn-zoomin").set "onbtclick", (e) ->
me.pan.zoomIn() if me.pan
(@find "btn-zoomout").set "onbtclick", (e) ->
me.pan.zoomOut() if me.pan
(@find "btn-reset").set "onbtclick", (e) ->
me.pan.resetZoom() if me.pan
@open @currfile
menu: () ->
me = @
menu = [{
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" },
{ text: "__(Render)", dataid: "#{@name}-Render", shortcut: "C-R" },
{
text: "__(Export as)",
child: [
{ text: "SVG", shortcut: "A-G" },
{ text: "PNG", shortcut: "A-P" }
],
onmenuselect: (e) -> me.export e.item.data.text
},
],
onmenuselect: (e) -> me.actionFile e.item.data.dataid
}]
menu
open: (file) ->
return if file.path is "Untitled"
me = @
file.dirty = false
file.read (d) ->
me.currfile = file
me.editormux = true
me.currfile.dirty = false
me.editor.setValue d
me.scheme.set "apptitle", "#{me.currfile.basename}"
me.renderSVG false
save: (file) ->
me = @
file.write "text/plain", (d) ->
return me.error __("Error saving file {0}", file.basename) if d.error
file.dirty = false
file.text = file.basename
me.scheme.set "apptitle", "#{me.currfile.basename}"
actionFile: (e) ->
me = @
saveas = () ->
me.openDialog "FileDiaLog", (d, n) ->
me.currfile.setPath "#{d}/#{n}"
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}-Render"
me.renderSVG false
when "#{@name}-New"
@currfile = "Untitled".asFileHandler()
@currfile.cache = ""
@currfile.dirty = false
@editormux = true
@editor.setValue("")
export: (t) ->
me = @
me.openDialog "FileDiaLog", (d, n) ->
fp = "#{d}/#{n}".asFileHandler()
try
switch t
when "SVG"
fp.cache = me.svgtext()
fp.write "text/plain", (r) ->
return me.error __("Cannot export to {0}: {1}", t, r.error) if r.error
me.notify __("File exported")
when "PNG"
# toDataURL("image/png")
me.svgToCanvas (canvas) ->
try
fp.cache = canvas.toDataURL "image/png"
fp.write "base64", (r) ->
return me.error __("Cannot export to {0}: {1}", t, r.error) if r.error
me.notify __("File exported")
catch e
me.error __("Cannot export to PNG in this browser: {0}", e.message)
catch e
me.error __("Cannot export: {0}", e.message)
, __("Export as"), { file: me.currfile }
renderSVG: (silent) ->
me = @
id = Math.floor(Math.random() * 100000) + 1
#if silent
# mermaid.parseError = (e, h) ->
#else
# mermaid.parseError = (e, h) ->
# me.error e
text = @editor.getValue()
try
mermaid.parse text
catch e
me.error __("Syntax error: {0}", e.str) if not silent
return
mermaid.render "c#{id}", text, (text, f) ->
me.preview.innerHTML = text
$(me.preview).append me.btctn
me.calibrate()
svg = $(me.preview).children("svg")[0]
$(svg).attr("style", "")
me.pan = svgPanZoom svg, {
zoomEnabled: true,
controlIconsEnabled: false,
fit: true,
center: true,
minZoom: 0.1
}
#rd $($.parseHTML text).
, me.preview
svgtext: () ->
svg = $(@preview).children("svg")[0]
serializer = new XMLSerializer()
return serializer.serializeToString(svg)
svgToCanvas: (f) ->
me = @
img = new Image()
svgStr = @svgtext()
img.onload = () ->
canvas = me.find "offscreen"
canvas.width = img.width
canvas.height = img.height
canvas.getContext("2d").drawImage img, 0, 0, img.width, img.height
f(canvas)
img.src = 'data:image/svg+xml;base64,' + btoa(svgStr)
calibrate: () ->
svg = ($ @preview).children("svg")[0]
if svg
prs = [$(@preview).width(), $(@preview).height()]
$(svg).attr "width", prs[0] + "px"
$(svg).attr "height", prs[1] + "px"
cleanup: (evt) ->
return unless @currfile.dirty
me = @
evt.preventDefault()
@.openDialog "YesNoDialog", (d) ->
if d
me.currfile.dirty = false
me.quit()
, __("Quit"), { text: __("Quit without saving ?") }
GraphEditor.dummymermaid = """
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
"""
GraphEditor.dependencies = [
"ace/ace"
]
this.OS.register "GraphEditor", GraphEditor

View File

@ -0,0 +1,22 @@
afx-app-window[data-id="graph_editor_win"] div[data-id="preview"]
{
display: flex;
align-items: center;
justify-content: center;
}
afx-app-window[data-id="graph_editor_win"] afx-button button
{
border-radius: 0;
padding-top:2px;
padding-bottom: 2px;
}
afx-app-window[data-id="graph_editor_win"] afx-resizer{
background-color: transparent;
}
afx-app-window[data-id="graph_editor_win"] div[data-id="btn-container"]{
background-color: transparent;
position: absolute;
bottom:10px;
right: 10px;
display: inline;
}

View File

@ -0,0 +1,14 @@
{
"app":"GraphEditor",
"name":"Graph Editor",
"description":"Create graph with dot language or mermaid",
"info":{
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com",
"licences": "GPLv3"
},
"version":"0.0.1-a",
"category":"Office",
"iconclass": "fa fa-sitemap",
"mimes":["text/.*graphviz"]
}

View File

@ -0,0 +1,14 @@
<afx-app-window data-id="graph_editor_win" apptitle="__(Graph editor)" width="650" height="500">
<afx-hbox>
<div data-id="datarea"></div>
<afx-resizer data-width="5" ></afx-resizer>
<div data-id="preview">
<div data-height="25" data-id="btn-container">
<afx-button data-id="btn-zoomin" iconclass="fa fa-search-plus"></afx-button>
<afx-button data-id="btn-zoomout" iconclass="fa fa-search-minus"></afx-button>
<afx-button data-id="btn-reset" iconclass="fa fa-square-o"></afx-button>
</div>
</div>
<canvas data-id="offscreen" data-width="0" style="display:none" ></canvas>
</afx-hbox>
</afx-app-window>

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 MarkOn extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "MarkOn", args
@ -65,6 +83,7 @@ class MarkOn extends this.OS.GUI.BaseApplication
me = @
file.dirty = false
file.read (d) ->
me.currfile = file
me.editormux = true
me.editor.value d
me.scheme.set "apptitle", "#{me.currfile.basename}"
@ -73,7 +92,7 @@ class MarkOn extends this.OS.GUI.BaseApplication
save: (file) ->
me = @
file.write (file.getb64 "text/plain"), (d) ->
file.write "text/plain", (d) ->
return me.error __("Error saving file {0}", file.basename) if d.error
file.dirty = false
file.text = file.basename

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1a",
"version":"0.0.1-a",
"category":"Utils",
"iconclass":"fa fa-leanpub",
"mimes":["text/.*"]

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 RepositoryDialog extends this.OS.GUI.BaseDialog
constructor: () ->
super "RepositoryDialog"
@ -72,5 +90,4 @@ RepositoryDialog.scheme = """
</div>
</afx-vbox>
</afx-app-window>
"""
this.OS.register "RepositoryDialog", RepositoryDialog
"""

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 = this
class MarketPlace extends this.OS.GUI.BaseApplication
constructor: (args) ->
@ -30,11 +48,12 @@ class MarketPlace extends this.OS.GUI.BaseApplication
return unless app
me._gui.launch app.className if app.className
@btinstall.set "onbtclick", (e) ->
me.install e
return me.update() if me.btinstall.get "dirty"
me.install()
@btremove.set "onbtclick", (e) ->
me.uninstall e
me.uninstall()
@bindKey "CTRL-R", () ->
me.openDialog "RepositoryDialog"
me.openDialog new RepositoryDialog()
fetchApps: (url) ->
me = @
@_api.get url, ( d ) ->
@ -46,13 +65,31 @@ class MarketPlace extends this.OS.GUI.BaseApplication
me.error __("Fail to fetch packages list from: {0}", url)
appDetail: (d) ->
me = @
($ @container).css "visibility", "visible"
( $ @appname ).html d.name
($ @appdesc).html d.description if d.description
($ @appdesc).prepend ($ "<img/>").attr("src", d.screenshot) if d.screenshot
if @systemsetting.system.packages[d.className]
(@find "vstat").set "text", ""
if d.description
d.description.asFileHandler().read (text) ->
converter = new showdown.Converter()
($ me.appdesc).html converter.makeHtml text
else
($ me.appdesc).empty()
pkgcache = @systemsetting.system.packages
@btinstall.set "text", "__(Install)"
@btinstall.set "dirty", false
if pkgcache[d.className]
vs = pkgcache[d.className].version
ovs = d.version
($ @btinstall).hide()
if vs and ovs
vs = vs.__v()
ovs = ovs.__v()
if ovs.nt vs
@btinstall.set "dirty", true
@btinstall.set "text", "__(Update)"
($ @btinstall).show()
(@find "vstat").set "text", __("Your application version is older ({0} < {1})", vs, ovs)
($ @btremove).show()
($ @btexec).show()
else
@ -70,11 +107,11 @@ class MarketPlace extends this.OS.GUI.BaseApplication
{ text: "__(Options)", child: [
{ text: "__(Repositories)", shortcut: "C-R" }
] , onmenuselect: (e) ->
me.openDialog "RepositoryDialog"
me.openDialog new RepositoryDialog()
}
]
install: (e) ->
install: (f) ->
me = @
app = @applist.get "selected"
return unless app
@ -111,7 +148,7 @@ class MarketPlace extends this.OS.GUI.BaseApplication
, (err, s) ->
return me.error __("Cannot down load the app {0}", err) if err
uninstall: (e) ->
uninstall: (f) ->
me = @
sel = @applist.get "selected"
name = sel.className
@ -125,10 +162,21 @@ class MarketPlace extends this.OS.GUI.BaseApplication
return me.error __("Cannot uninstall package: {0}", r.error) if r.error
me.notify __("Package uninstalled")
delete me.systemsetting.system.packages[name]
me._gui.unloadApp name
me._gui.refreshSystemMenu()
me.appDetail sel
f() if f
, __("Uninstall") ,
{ text: __("Uninstall : {0}?", app.name) }
{ text: __("Uninstall: {0}?", app.name) }
update: () ->
me = @
new Promise (r, e) ->
me.uninstall () ->
r()
.then () ->
me.install()
mkdirs: (n, list, f) ->
me = @
if list.length is 0
@ -155,6 +203,6 @@ class MarketPlace extends this.OS.GUI.BaseApplication
return me.installFile n, zip, files, f if r.result
me.error __("Cannot install {0}", path)
MarketPlace.dependencies = [ "jszip.min" ]
MarketPlace.dependencies = [ "jszip.min", "showdown.min" ]
MarketPlace.singleton = true
this.OS.register "MarketPlace", MarketPlace

View File

@ -61,6 +61,15 @@ afx-app-window[data-id="marketplace-win"] ul[data-id='app-detail'] span{
afx-app-window[data-id="marketplace-win"] span.info-header{
font-weight: bold;
}
afx-app-window[data-id="marketplace-win"] afx-label[data-id="vstat"] {
font-size: 11px;
color: chocolate;
}
afx-app-window[data-id="marketplace-win"] p.stat {
margin: 0;
padding:0;
margin-bottom: 10px;
}
afx-app-window[data-id = "repository-dialog-win"] afx-list-view[data-id="repo-list"] ul.complex-content > li{
font-size: 11px;
font-style: italic;

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-adn",
"mimes":["none"]

View File

@ -7,14 +7,15 @@
<afx-resizer data-width = "3" ></afx-resizer>
<afx-vbox data-id = "container">
<div data-id = "appname" data-height = "25"></div>
<afx-hbox data-height = "25">
<afx-hbox data-height = "grow">
<div style = "text-align:left;">
<afx-button data-id = "bt-remove" text = "__(Uninstall)"></afx-button>
<afx-button data-id = "bt-exec" text = "__(Launch)"></afx-button>
<afx-button data-id = "bt-install" text = "__(Install)" ></afx-button>
<p class="stat"><afx-label data-id="vstat"></afx-label></p>
</div>
</afx-hbox>
<div>
<div data-height = "grow">
<p data-id = "app-desc"></p>
<ul data-id = "app-detail"></ul>
</div>

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 NotePad extends this.OS.GUI.BaseApplication
constructor: ( args ) ->
super "NotePad", args

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-pencil-square-o",
"mimes":[

View File

@ -1,12 +1,12 @@
<afx-app-window apptitle="" width="600" height="400" data-id="notepad">
<afx-hbox>
<afx-vbox data-width = "172" data-id = "sidebar" min-width="172">
<afx-vbox data-width = "155" data-id = "sidebar" min-width="155">
<afx-list-view data-id = "location" dropdown = "true" data-height= "30" width = "150"></afx-list-view>
<afx-file-view data-id = "fileview" view='tree' status = false></afx-file-view>
</afx-vbox>
<afx-resizer data-width = "3" ></afx-resizer>
<afx-vbox>
<afx-tab-bar data-id="tabarea" data-height="26" closable = true></afx-tab-bar>
<afx-tab-bar data-id="tabarea" data-height="23" closable = true></afx-tab-bar>
<div data-id="datarea"></div>
<afx-hbox data-height="30" data-id="bottom-vbox">
<afx-label data-id="editorstat"></afx-label>

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 Preview extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "Preview", args
@ -28,6 +46,8 @@ class Preview extends this.OS.GUI.BaseApplication
return unless mime
if mime.match /^[^\/]+\/.*pdf.*/g
@renderPDF file
else if mime.match /image\/.*svg.*/g
@renderSVG file
else if mime.match /image\/.*/g
@renderImage file
else
@ -72,14 +92,19 @@ class Preview extends this.OS.GUI.BaseApplication
me._api.loaded q, "FAIL"
, "binary"
renderSVG: (file) ->
me = @
($ @view).attr("class", "image").empty()
file.read (d) ->
#console.log d
me.view.innerHTML = d
renderImage: (file) ->
me = @
($ @view).attr("class", "image").empty()
file.read (d) ->
blob = new Blob [d], { type: file.mime }
img = new Image()
img.src = URL.createObjectURL blob
canvas = ($ "<canvas/>")[0]
($ me.view).append canvas
@ -88,9 +113,12 @@ class Preview extends this.OS.GUI.BaseApplication
context = canvas.getContext '2d'
canvas.height = img.height
canvas.width = img.width
console.log canvas.width, canvas.height
#console.log canvas.width, canvas.height
context.drawImage img, 0, 0
me.setStatus "#{file.info.name} (#{file.info.size} Kb) - #{img.width}x#{img.height}"
blob = new Blob [d], { type: file.info.mime }
img.src = URL.createObjectURL blob
, "binary"
menu: () ->

View File

@ -6,7 +6,7 @@
"author": "Xuan Sang LE",
"email": "xsang.le@gmail.com"
},
"version":"0.1a",
"version":"0.0.1-a",
"category":"Utils",
"iconclass":"fa fa-eye",
"mimes":["[^\/]*/.*pdf", "image/.*"]

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 AppearanceHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)

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 LocaleHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)

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 StartupHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)

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 VFSHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)

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 SettingHandler
constructor:(@scheme, @parent) ->

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-wrench",
"mimes":["none"]

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 wTerm extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "wTerm", args

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-terminal",
"mimes":["none"]

View File

@ -11,6 +11,7 @@ afx-file-view afx-label.status{
background-color: #f6F6F6;
border-top: 1px solid #cbcbcb;
color:#414339;
transform: translateZ(0);
}
afx-file-view afx-list-view > div.list-container > ul > li{
float:left;

View File

@ -1,6 +1,6 @@
afx-list-view{
overflow:hidden;
padding: 5px;
/*padding: 5px;*/
display: block;
}
/*
@ -94,7 +94,7 @@ afx-list-view.dropdown > div.list-container > ul{
border:1px solid #a6a6a6;
box-shadow: 1px 1px 1px #9f9F9F;
border-radius: 3px;
padding:2px;
/*padding:2px;*/
border-top-left-radius: 0px;
z-index: 10;
}
@ -104,13 +104,17 @@ afx-list-view.dropdown > div.list-container > ul > li{
}
afx-list-view.dropdown div.list-container div{
padding:3px;
color: #414339;
padding-top:3px;
padding-bottom: 3px;
border:1px solid #a6a6a6;
border-radius: 3px;
padding-right:15px;
background-color: white;
height: 17px;
}
afx-list-view.dropdown div.list-container div > afx-label{
padding-left:3px;
}
afx-list-view.dropdown div.list-container div:before {
content: "\f107";
font-family: "FontAwesome";

View File

@ -0,0 +1,33 @@
afx-slider{
display: flex;
align-items: center;
justify-content: center;
}
afx-slider div.container{
display: block;
border:0;
border-radius: 3px;
height: 5px;
background-color: #e6e6e6;
position: relative;
padding:0;
cursor: pointer;
}
afx-slider div.progress {
padding:0;
margin: 0;
display: block;
background-color: #116cd6;
border:0;
border-radius: 3px;
}
afx-slider div.dragpoint {
display: block;
width: 20px;
height: 20px;
border:1px solid #6b6b6b;
border-radius: 20px;
background-color:#e6e6e6;
}

View File

@ -81,6 +81,16 @@ html,body{
font-weight: normal;
font-style: normal;
}
#systooltip {
border:1px solid #a6a6a6;
border-radius: 3px;
padding-left:3px;
padding-right:3px;
/*box-shadow: 2px 2px 2px #cbcbcb;*/
box-shadow: 1px 1px 1px #9f9F9F;
background-color: #e7e7e7;
z-index: 99999;
}
input {
outline: none;
padding: 2px;