diff --git a/.gitignore b/.gitignore index caf29c8..3fc21ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -/res/css/.sass-cache -/res/css/*.map -/screenshots/ +node_modules +dist +test/temp +bower_components +.tmp +test/bower_components/ diff --git a/LICENSE b/LICENSE index 6b156fe..7ba963c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,675 +1,22 @@ -GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -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: - - {project} Copyright (C) {year} {fullname} - 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 -. - - 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 -. - +COPYRIGHT (c) 2015 mmk2410 + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index da140f3..2a49304 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,39 @@ -# morse-converter-web -A writtenMorse and normal Morse converter for the web +# [Morse Converter (web)](https://marcel-kapfer.de/writtenmorse/morseconverter) +**This is a beta version. It may contains bugs** -**This is in an Alpha stage - use it on your own risk** +This is a Morse and [writtenMorse](https://marcel-kapfer.de/writtenmorse) converter for the web. With mobile-first in mind I tried to create a beautiful converting experience. The webapp comes with [Material design](https://google.com/design) and with enhanced features (like instant converting) to simplify the converting time. + +## Use it + +The webapp can be accessed at [marcel-kapfer.de/writtenmorse/morseconverter](https://marcel-kapfer.de/writtenmorse/morseconverter). + +## Contribute + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create New Pull Request + +## Build + +You need the following programs installed on your computer: + +``` +npm, bower, gulp +``` + +To see your changes run the first time: + +``` +npm install && bower install +``` + +and the rebuild the webapp with: + +``` +gulp +``` + +The webapp is accessible in the `dist/` directory diff --git a/app/elements/app-theme.html b/app/elements/app-theme.html new file mode 100644 index 0000000..63b0d6c --- /dev/null +++ b/app/elements/app-theme.html @@ -0,0 +1,54 @@ + diff --git a/app/elements/elements.html b/app/elements/elements.html new file mode 100644 index 0000000..0570dcf --- /dev/null +++ b/app/elements/elements.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/images/touch/apple-touch-icon.png b/app/images/touch/apple-touch-icon.png new file mode 100644 index 0000000..1576e3f Binary files /dev/null and b/app/images/touch/apple-touch-icon.png differ diff --git a/app/images/touch/chrome-touch-icon-192x192.png b/app/images/touch/chrome-touch-icon-192x192.png new file mode 100644 index 0000000..6282078 Binary files /dev/null and b/app/images/touch/chrome-touch-icon-192x192.png differ diff --git a/app/images/touch/icon-128x128.png b/app/images/touch/icon-128x128.png new file mode 100644 index 0000000..18c554d Binary files /dev/null and b/app/images/touch/icon-128x128.png differ diff --git a/app/images/touch/ms-touch-icon-144x144-precomposed.png b/app/images/touch/ms-touch-icon-144x144-precomposed.png new file mode 100644 index 0000000..ec5406f Binary files /dev/null and b/app/images/touch/ms-touch-icon-144x144-precomposed.png differ diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..8d39fc5 --- /dev/null +++ b/app/index.html @@ -0,0 +1,123 @@ + + + + + + Morse Converter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/manifest.json b/app/manifest.json new file mode 100644 index 0000000..0a1a385 --- /dev/null +++ b/app/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "Morse Converter", + "short_name": "Morse Converter", + "icons" : [{ + "src": "images/touch/icon-128x128.png", + "sizes": "128x128" + }, { + "src": "images/touch/apple-touch-icon.png", + "sizes": "152x152" + }, { + "src": "images/touch/ms-touch-icon-144x144-precomposed.png", + "sizes": "144x144" + }, { + "src": "images/touch/chrome-touch-icon-192x192.png", + "sizes": "192x192" + }], + "start_url": "./", + "display": "standalone" +} diff --git a/app/precache.json b/app/precache.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/app/precache.json @@ -0,0 +1 @@ +[] diff --git a/app/scripts/CodeRecognization.coffee b/app/scripts/CodeRecognization.coffee new file mode 100644 index 0000000..8db5129 --- /dev/null +++ b/app/scripts/CodeRecognization.coffee @@ -0,0 +1,59 @@ +isNormalMorseCode = (input) -> + input = input.toLowerCase() + return !(input.indexOf("a") > -1 or input.indexOf("b") > -1 or + input.indexOf("c") > -1 or input.indexOf("d") > -1 or + input.indexOf("e") > -1 or input.indexOf("f") > -1 or + input.indexOf("g") > -1 or input.indexOf("h") > -1 or + input.indexOf("i") > -1 or input.indexOf("j") > -1 or + input.indexOf("k") > -1 or input.indexOf("l") > -1 or + input.indexOf("m") > -1 or input.indexOf("n") > -1 or + input.indexOf("o") > -1 or input.indexOf("p") > -1 or + input.indexOf("q") > -1 or input.indexOf("r") > -1 or + input.indexOf("s") > -1 or input.indexOf("t") > -1 or + input.indexOf("u") > -1 or input.indexOf("v") > -1 or + input.indexOf("w") > -1 or input.indexOf("x") > -1 or + input.indexOf("y") > -1 or input.indexOf("z") > -1 or + input.indexOf("0") > -1 or input.indexOf("1") > -1 or + input.indexOf("2") > -1 or input.indexOf("3") > -1 or + input.indexOf("4") > -1 or input.indexOf("5") > -1 or + input.indexOf("6") > -1 or input.indexOf("7") > -1 or + input.indexOf("8") > -1 or input.indexOf("9") > -1 or + input.indexOf("Ä") > -1 or input.indexOf("Ö") > -1 or + input.indexOf("Ü") > -1 or input.indexOf("ß") > -1 or + input.indexOf("$") > -1 or input.indexOf(",") > -1 or + input.indexOf(":") > -1 or input.indexOf(";") > -1 or + input.indexOf("!") > -1 or input.indexOf("?") > -1 or + input.indexOf("+") > -1 or input.indexOf("_") > -1 or + input.indexOf("(") > -1 or input.indexOf(")") > -1 or + input.indexOf("=") > -1 or input.indexOf("/") > -1 or + input.indexOf("@") > -1 or input.indexOf("'") > -1) + +isWrittenMorseCode = (input) -> + input = input.toLowerCase() + return not (input.indexOf("a") > -1 or input.indexOf("b") > -1 or + input.indexOf("c") > -1 or input.indexOf("d") > -1 or + input.indexOf("e") > -1 or input.indexOf("f") > -1 or + input.indexOf("g") > -1 or input.indexOf("h") > -1 or + input.indexOf("i") > -1 or input.indexOf("j") > -1 or + input.indexOf("k") > -1 or input.indexOf("l") > -1 or + input.indexOf("m") > -1 or input.indexOf("n") > -1 or + input.indexOf("o") > -1 or input.indexOf("p") > -1 or + input.indexOf("q") > -1 or input.indexOf("r") > -1 or + input.indexOf("s") > -1 or input.indexOf("t") > -1 or + input.indexOf("u") > -1 or input.indexOf("v") > -1 or + input.indexOf("w") > -1 or input.indexOf("x") > -1 or + input.indexOf("y") > -1 or input.indexOf("z") > -1 or + input.indexOf("2") > -1 or input.indexOf("3") > -1 or + input.indexOf("4") > -1 or input.indexOf("5") > -1 or + input.indexOf("6") > -1 or input.indexOf("7") > -1 or + input.indexOf("8") > -1 or input.indexOf("9") > -1 or + input.indexOf("Ä") > -1 or input.indexOf("Ö") > -1 or + input.indexOf("Ü") > -1 or input.indexOf("ß") > -1 or + input.indexOf(".") > -1 or input.indexOf(",") > -1 or + input.indexOf(":") > -1 or input.indexOf(";") > -1 or + input.indexOf("!") > -1 or input.indexOf("?") > -1 or + input.indexOf("-") > -1 or input.indexOf("_") > -1 or + input.indexOf("(") > -1 or input.indexOf(")") > -1 or + input.indexOf("=") > -1 or input.indexOf("/") > -1 or + input.indexOf("@") > -1 or input.indexOf("'") > -1 or + input.indexOf("$") > -1) diff --git a/app/scripts/CodeRecognization.js b/app/scripts/CodeRecognization.js new file mode 100644 index 0000000..d634cd5 --- /dev/null +++ b/app/scripts/CodeRecognization.js @@ -0,0 +1,11 @@ +var isNormalMorseCode, isWrittenMorseCode; + +isNormalMorseCode = function(input) { + input = input.toLowerCase(); + return !(input.indexOf("a") > -1 || input.indexOf("b") > -1 || input.indexOf("c") > -1 || input.indexOf("d") > -1 || input.indexOf("e") > -1 || input.indexOf("f") > -1 || input.indexOf("g") > -1 || input.indexOf("h") > -1 || input.indexOf("i") > -1 || input.indexOf("j") > -1 || input.indexOf("k") > -1 || input.indexOf("l") > -1 || input.indexOf("m") > -1 || input.indexOf("n") > -1 || input.indexOf("o") > -1 || input.indexOf("p") > -1 || input.indexOf("q") > -1 || input.indexOf("r") > -1 || input.indexOf("s") > -1 || input.indexOf("t") > -1 || input.indexOf("u") > -1 || input.indexOf("v") > -1 || input.indexOf("w") > -1 || input.indexOf("x") > -1 || input.indexOf("y") > -1 || input.indexOf("z") > -1 || input.indexOf("0") > -1 || input.indexOf("1") > -1 || input.indexOf("2") > -1 || input.indexOf("3") > -1 || input.indexOf("4") > -1 || input.indexOf("5") > -1 || input.indexOf("6") > -1 || input.indexOf("7") > -1 || input.indexOf("8") > -1 || input.indexOf("9") > -1 || input.indexOf("Ä") > -1 || input.indexOf("Ö") > -1 || input.indexOf("Ü") > -1 || input.indexOf("ß") > -1 || input.indexOf("$") > -1 || input.indexOf(",") > -1 || input.indexOf(":") > -1 || input.indexOf(";") > -1 || input.indexOf("!") > -1 || input.indexOf("?") > -1 || input.indexOf("+") > -1 || input.indexOf("_") > -1 || input.indexOf("(") > -1 || input.indexOf(")") > -1 || input.indexOf("=") > -1 || input.indexOf("/") > -1 || input.indexOf("@") > -1 || input.indexOf("'") > -1); +}; + +isWrittenMorseCode = function(input) { + input = input.toLowerCase(); + return !(input.indexOf("a") > -1 || input.indexOf("b") > -1 || input.indexOf("c") > -1 || input.indexOf("d") > -1 || input.indexOf("e") > -1 || input.indexOf("f") > -1 || input.indexOf("g") > -1 || input.indexOf("h") > -1 || input.indexOf("i") > -1 || input.indexOf("j") > -1 || input.indexOf("k") > -1 || input.indexOf("l") > -1 || input.indexOf("m") > -1 || input.indexOf("n") > -1 || input.indexOf("o") > -1 || input.indexOf("p") > -1 || input.indexOf("q") > -1 || input.indexOf("r") > -1 || input.indexOf("s") > -1 || input.indexOf("t") > -1 || input.indexOf("u") > -1 || input.indexOf("v") > -1 || input.indexOf("w") > -1 || input.indexOf("x") > -1 || input.indexOf("y") > -1 || input.indexOf("z") > -1 || input.indexOf("2") > -1 || input.indexOf("3") > -1 || input.indexOf("4") > -1 || input.indexOf("5") > -1 || input.indexOf("6") > -1 || input.indexOf("7") > -1 || input.indexOf("8") > -1 || input.indexOf("9") > -1 || input.indexOf("Ä") > -1 || input.indexOf("Ö") > -1 || input.indexOf("Ü") > -1 || input.indexOf("ß") > -1 || input.indexOf(".") > -1 || input.indexOf(",") > -1 || input.indexOf(":") > -1 || input.indexOf(";") > -1 || input.indexOf("!") > -1 || input.indexOf("?") > -1 || input.indexOf("-") > -1 || input.indexOf("_") > -1 || input.indexOf("(") > -1 || input.indexOf(")") > -1 || input.indexOf("=") > -1 || input.indexOf("/") > -1 || input.indexOf("@") > -1 || input.indexOf("'") > -1 || input.indexOf("$") > -1); +}; diff --git a/app/scripts/app.js b/app/scripts/app.js new file mode 100644 index 0000000..c288aa2 --- /dev/null +++ b/app/scripts/app.js @@ -0,0 +1,114 @@ +(function (document) { + 'use strict'; + + var app = document.querySelector('#app'); + + app.displayInstalledToast = function() { + document.querySelector('#caching-complete').show(); + }; + + app.addEventListener('template-bound', function() { + console.log("Marcel Kapfer (mmk2410)"); + console.log("Morse Converter beta"); + console.log("Version 0.2"); + }); + + window.addEventListener('WebComponentsReady', function() { + document.querySelector('body').removeAttribute('unresolved'); + + // Ensure that the drawer is always hidden + var drawerPanel = document.querySelector('#paperDrawerPanel'); + drawerPanel.forceNarrow = true; + + // initialize the app + var inputArea, menuAbout, menuFork, menuNormalMorse, menuReportBug, menuWrittenMorse, outputArea, outputPaper, toastNormalMorse, toastWrittenMorse, writtenMorse; + writtenMorse = true; + toastWrittenMorse = document.querySelector('#toastWrittenMorse'); + toastNormalMorse = document.querySelector('#toastNormalMorse'); + inputArea = document.querySelector('#inputArea'); + outputArea = document.querySelector('#outputArea'); + outputPaper = document.querySelector('#outputPaper'); + menuWrittenMorse = document.querySelector('#menuWrittenMorse'); + menuWrittenMorse.addEventListener('click', function() { + writtenMorse = true; + fadeOut(outputPaper); + inputArea.value = ""; + drawerPanel.closeDrawer(); + toastWrittenMorse.toggle(); + }); + menuNormalMorse = document.querySelector('#menuNormalMorse'); + menuNormalMorse.addEventListener('click', function() { + writtenMorse = false; + fadeOut(outputPaper); + inputArea.value = ""; + drawerPanel.closeDrawer(); + toastNormalMorse.toggle(); + }); + menuReportBug = document.querySelector('#menuReportBug'); + menuReportBug.addEventListener('click', function() { + window.open("https://github.com/mmk2410/morse-converter-web/issues", "_blank"); + drawerPanel.closeDrawer(); + }); + menuAbout = document.querySelector('#menuAbout'); + menuAbout.addEventListener('click', function() { + window.open("https://marcel-kapfer.de/writtenmorse", "_blank"); + drawerPanel.closeDrawer(); + }); + menuFork = document.querySelector('#menuFork'); + menuFork.addEventListener('click', function() { + window.open("https://github.com/mmk2410/morse-converter-web/", "_blank"); + drawerPanel.closeDrawer(); + }); + inputArea.addEventListener('keyup', function() { + var string; + if (input.value.trim()) { + if(outputPaper.style.display == 'none') { + fadeIn(outputPaper); + } + if (writtenMorse) { + if (isWrittenMorseCode(input.value)) { + string = getWrittenMorseEncoded(input.value); + } else { + string = getWrittenMorseDecoded(input.value); + } + } else { + if (isNormalMorseCode(input.value)) { + string = getNormalMorseEncoded(input.value); + } else { + string = getNormalMorseDecoded(input.value); + } + } + outputArea.innerHTML = string; + } else { + fadeOut(outputPaper); + } + }); + }); + +})(document); + +function fadeOut(element) { + var op = 1; // initial opacity + var timer = setInterval(function () { + if (op <= 0.1){ + clearInterval(timer); + element.style.display = 'none'; + } + element.style.opacity = op; + element.style.filter = 'alpha(opacity=' + op * 100 + ")"; + op -= op * 0.1; + }, 10); +} + +function fadeIn(element) { + var op = 0.1; // initial opacity + element.style.display = 'block'; + var timer = setInterval(function () { + if (op >= 1){ + clearInterval(timer); + } + element.style.opacity = op; + element.style.filter = 'alpha(opacity=' + op * 100 + ")"; + op += op * 0.1; + }, 10); +} diff --git a/app/scripts/normalMorseConvert.coffee b/app/scripts/normalMorseConvert.coffee new file mode 100644 index 0000000..a7e41d6 --- /dev/null +++ b/app/scripts/normalMorseConvert.coffee @@ -0,0 +1,522 @@ +getNormalMorseDecoded = (input) -> + # Well, this shouldn't happen... + if !(input) + return null + + # remove trailing whitspaces + if input.charAt input.length is " " + input.substring 0, input.length - 1 + + input = input.toUpperCase() + output = "" + + # Return special signs + if input is "LETTERSPACE" + return "   " + else if input is "END OF WORK" + return "...-.-" + else if input is "ERROR" + return "........" + else if input is "STARTING SIGNAL" + return "-.-.-" + else if input is "ENDING SIGNAL" + return ".-.-." + else if input is "UNDERSTOOD" + return "...-." + else if input is "WAIT" + return ".-..." + else if input is "SOS" + return "...---..." + else if input is "LETTER SPACE" + return "   " + else if input is "WORD SPACE" + return "       " + else # the converting part + + while input.length > 0 + + if input.charAt(0) is " " + if output.charAt(output.length) is " " + output = output.substring 0, output.length - 1 + output += "       " + input = input.substring 1 + + else if input.charAt(0) is "\n" + output += "
" + input = input.substring 1 + + else if input.charAt(0) is "A" + output += ".-   " + input = input.substring 1 + + else if input.charAt(0) is "B" + output += "-...   " + input = input.substring 1 + + else if input.charAt(0) is "C" + output += "-.-.   " + input = input.substring 1 + + else if input.charAt(0) is "D" + output += "-..   " + input = input.substring 1 + + else if input.charAt(0) is "E" + output += ".   " + input = input.substring 1 + + else if input.charAt(0) is "F" + output += "..-.   " + input = input.substring 1 + + else if input.charAt(0) is "G" + output += "--.   " + input = input.substring 1 + + else if input.charAt(0) is "H" + output += "....   " + input = input.substring 1 + + else if input.charAt(0) is "I" + output += "..   " + input = input.substring 1 + + else if input.charAt(0) is "J" + output += ".---   " + input = input.substring 1 + + else if input.charAt(0) is "K" + output += "-.-   " + input = input.substring 1 + + else if input.charAt(0) is "L" + output += ".-..   " + input = input.substring 1 + + else if input.charAt(0) is "M" + output += "--   " + input = input.substring 1 + + else if input.charAt(0) is "N" + output += "-.   " + input = input.substring 1 + + else if input.charAt(0) is "O" + output += "---   " + input = input.substring 1 + + else if input.charAt(0) is "P" + output += ".--.   " + input = input.substring 1 + + else if input.charAt(0) is "Q" + output += "--.-   " + input = input.substring 1 + + else if input.charAt(0) is "R" + output += ".-.   " + input = input.substring 1 + + else if input.charAt(0) is "S" + output += "...   " + input = input.substring 1 + + else if input.charAt(0) is "T" + output += "-   " + input = input.substring 1 + + else if input.charAt(0) is "U" + output += "..-   " + input = input.substring 1 + + else if input.charAt(0) is "V" + output += "...-   " + input = input.substring 1 + + else if input.charAt(0) is "W" + output += ".--   " + input = input.substring 1 + + else if input.charAt(0) is "X" + output += "-..-   " + input = input.substring 1 + + else if input.charAt(0) is "Y" + output += "-.--   " + input = input.substring 1 + + else if input.charAt(0) is "Z" + output += "--..   " + input = input.substring 1 + + else if input.charAt(0) is "0" + output += "-----   " + input = input.substring 1 + + else if input.charAt(0) is "1" + output += ".----   " + input = input.substring 1 + + else if input.charAt(0) is "2" + output += "..---   " + input = input.substring 1 + + else if input.charAt(0) is "3" + output += "...--   " + input = input.substring 1 + + else if input.charAt(0) is "4" + output += "....-   " + input = input.substring 1 + + else if input.charAt(0) is "5" + output += ".....   " + input = input.substring 1 + + else if input.charAt(0) is "6" + output += "-....   " + input = input.substring 1 + + else if input.charAt(0) is "7" + output += "--...   " + input = input.substring 1 + + else if input.charAt(0) is "8" + output += "---..   " + input = input.substring 1 + + else if input.charAt(0) is "9" + output += "----.   " + input = input.substring 1 + + else if input.charAt(0) is "Ä" + output += ".-.-   " + input = input.substring 1 + + else if input.charAt(0) is "Ö" + output += "---.   " + input = input.substring 1 + + else if input.charAt(0) is "Ü" + output += "..--   " + input = input.substring 1 + + else if input.charAt(0) is "ß" + output += "...--...   " + input = input.substring 1 + + else if input.charAt(0) is "." + output += ".-.-.-   " + input = input.substring 1 + + else if input.charAt(0) is "," + output += "--..--   " + input = input.substring 1 + + else if input.charAt(0) is ":" + output += "---...   " + input = input.substring 1 + + else if input.charAt(0) is "" + output += "-.-.-.   " + input = input.substring 1 + + else if input.charAt(0) is "?" + output += "..--..   " + input = input.substring 1 + + else if input.charAt(0) is "!" + output += "-.-.--   " + input = input.substring 1 + + else if input.charAt(0) is "-" + output += "-....-   " + input = input.substring 1 + + else if input.charAt(0) is "_" + output += "..--.-   " + input = input.substring 1 + + else if input.charAt(0) is "(" + output += "-.--.   " + input = input.substring 1 + + else if input.charAt(0) is ")" + output += "-.--.-   " + input = input.substring 1 + + else if input.charAt(0) is "=" + output += "-...-   " + input = input.substring 1 + + else if input.charAt(0) is "+" + output += ".-.-.   " + input = input.substring 1 + + else if input.charAt(0) is "/" + output += "-..-.   " + input = input.substring 1 + + else if input.charAt(0) is "@" + output += ".--.-.   " + input = input.substring 1 + + else if input.charAt(0) is "'" + output += ".----.   " + input = input.substring 1 + + else if input.charAt(0) is "$" + output += "...-..-   " + input = input.substring 1 + + else + return "Code not listed or wrong." + + if output.charAt(output.length - 1) is " " + output = output.substring 0, output.length - 1 + + return output + +getNormalMorseEncoded = (input) -> + # Well, this shouldn't happen... + if !(input) then return null + + # remove trailing whitspaces + while input.charAt(input.length - 1) is " " + input = input.substring 0, input.length - 1 + + input = input.toUpperCase() + + # remove all trailing new lines + while input.charAt(input.length - 1) is "\n" + input = input.substring 0, input.length - 1 + + # add one letterspace to the input + input += " " + + inputToSign = input + output = "" + + while inputToSign isnt " " + + d = 0 + signFull = true + sign = "" + + while signFull + + if inputToSign.substring(d, d + 7) is " " or + inputToSign.substring(d, d + 3) is " " or + inputToSign.charAt(0) is "\n" + + if d is 0 + + if inputToSign.substring(0, 7) is " " + output += " " + inputToSign = inputToSign.substring 7, inputToSign.length + + if inputToSign.substring(0, 3) is " " + inputToSign = inputToSign.substring 3, inputToSign.length + + if inputToSign.charAt(0) is "\n" + output += "
" + inputToSign = inputToSign.substring 1, inputToSign.length + + else + sign = inputToSign.substring 0, d + inputToSign = inputToSign.substring d, inputToSign.length + signFull = false + + else + d++ + + if sign is ".-" + output += "A" + + else if sign is "-..." + output += "B" + + else if sign is "-.-." + output += "C" + + else if sign is "-.." + output += "D" + + else if sign is "." + output += "E" + + else if sign is "..-." + output += "F" + + else if sign is "--." + output += "G" + + else if sign is "...." + output += "H" + + else if sign is ".." + output += "I" + + else if sign is ".---" + output += "J" + + else if sign is "-.-" + output += "K" + + else if sign is ".-.." + output += "L" + + else if sign is "--" + output += "M" + + else if sign is "-." + output += "N" + + else if sign is "---" + output += "O" + + else if sign is ".--." + output += "P" + + else if sign is "--.-" + output += "Q" + + else if sign is ".-." + output += "R" + + else if sign is "..." + output += "S" + + else if sign is "-" + output += "T" + + else if sign is "..-" + output += "U" + + else if sign is "...-" + output += "V" + + else if sign is ".--" + output += "W" + + else if sign is "-..-" + output += "X" + + else if sign is "-.--" + output += "Y" + + else if sign is "--.." + output += "Z" + + else if sign is "-----" + output += "0" + + else if sign is ".----" + output += "1" + + else if sign is "..---" + output += "2" + + else if sign is "...--" + output += "3" + + else if sign is "....-" + output += "4" + + else if sign is "....." + output += "5" + + else if sign is "-...." + output += "6" + + else if sign is "--..." + output += "7" + + else if sign is "---.." + output += "8" + + else if sign is "----." + output += "9" + + else if sign is ".-.-" + output += "Ä" + + else if sign is "---." + output += "Ö" + + else if sign is "..--" + output += "Ü" + + else if sign is "...--..." + output += "ß" + + else if sign is "----" + output += "CH" + + else if sign is ".-.-.-" + output += "." + + else if sign is "--..--" + output += "," + + else if sign is "---..." + output += ":" + + else if sign is "-.-.-." + output += ";" + + else if sign is "..--.." + output += "?" + + else if sign is "-.-.--" + output += "!" + + else if sign is "-....-" + output += "-" + + else if sign is "..--.-" + output += "_" + + else if sign is "-.--." + output += "(" + + else if sign is "-.--.-" + output += ")" + + else if sign is ".----." + output += "'" + + else if sign is "-...-" + output += "=" + + else if sign is ".-.-." + output += "+" + + else if sign is "-..-." + output += "/" + + else if sign is ".--.-." + output += "@" + + else if sign is "-.-.-" + output += "Begin of the signal" + + else if sign is "-...-" + output += "Wait" + + else if sign is "...-." + output += "Understood" + + else if sign is "...-.-" + output += "End of work" + + else if sign is "...---..." + output += "SOS" + + else if sign is "........" + output += "Error" + + else + return "Code not listed or wrong." + + return output diff --git a/app/scripts/normalMorseConvert.js b/app/scripts/normalMorseConvert.js new file mode 100644 index 0000000..8175e6e --- /dev/null +++ b/app/scripts/normalMorseConvert.js @@ -0,0 +1,394 @@ +var getNormalMorseDecoded, getNormalMorseEncoded; + +getNormalMorseDecoded = function(input) { + var output; + if (!input) { + return null; + } + if (input.charAt(input.length === " ")) { + input.substring(0, input.length - 1); + } + input = input.toUpperCase(); + output = ""; + if (input === "LETTERSPACE") { + return "   "; + } else if (input === "END OF WORK") { + return "...-.-"; + } else if (input === "ERROR") { + return "........"; + } else if (input === "STARTING SIGNAL") { + return "-.-.-"; + } else if (input === "ENDING SIGNAL") { + return ".-.-."; + } else if (input === "UNDERSTOOD") { + return "...-."; + } else if (input === "WAIT") { + return ".-..."; + } else if (input === "SOS") { + return "...---..."; + } else if (input === "LETTER SPACE") { + return "   "; + } else if (input === "WORD SPACE") { + return "       "; + } else { + while (input.length > 0) { + if (input.charAt(0) === " ") { + if (output.charAt(output.length) === " ") { + output = output.substring(0, output.length - 1); + } + output += "       "; + input = input.substring(1); + } else if (input.charAt(0) === "\n") { + output += "
"; + input = input.substring(1); + } else if (input.charAt(0) === "A") { + output += ".-   "; + input = input.substring(1); + } else if (input.charAt(0) === "B") { + output += "-...   "; + input = input.substring(1); + } else if (input.charAt(0) === "C") { + output += "-.-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "D") { + output += "-..   "; + input = input.substring(1); + } else if (input.charAt(0) === "E") { + output += ".   "; + input = input.substring(1); + } else if (input.charAt(0) === "F") { + output += "..-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "G") { + output += "--.   "; + input = input.substring(1); + } else if (input.charAt(0) === "H") { + output += "....   "; + input = input.substring(1); + } else if (input.charAt(0) === "I") { + output += "..   "; + input = input.substring(1); + } else if (input.charAt(0) === "J") { + output += ".---   "; + input = input.substring(1); + } else if (input.charAt(0) === "K") { + output += "-.-   "; + input = input.substring(1); + } else if (input.charAt(0) === "L") { + output += ".-..   "; + input = input.substring(1); + } else if (input.charAt(0) === "M") { + output += "--   "; + input = input.substring(1); + } else if (input.charAt(0) === "N") { + output += "-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "O") { + output += "---   "; + input = input.substring(1); + } else if (input.charAt(0) === "P") { + output += ".--.   "; + input = input.substring(1); + } else if (input.charAt(0) === "Q") { + output += "--.-   "; + input = input.substring(1); + } else if (input.charAt(0) === "R") { + output += ".-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "S") { + output += "...   "; + input = input.substring(1); + } else if (input.charAt(0) === "T") { + output += "-   "; + input = input.substring(1); + } else if (input.charAt(0) === "U") { + output += "..-   "; + input = input.substring(1); + } else if (input.charAt(0) === "V") { + output += "...-   "; + input = input.substring(1); + } else if (input.charAt(0) === "W") { + output += ".--   "; + input = input.substring(1); + } else if (input.charAt(0) === "X") { + output += "-..-   "; + input = input.substring(1); + } else if (input.charAt(0) === "Y") { + output += "-.--   "; + input = input.substring(1); + } else if (input.charAt(0) === "Z") { + output += "--..   "; + input = input.substring(1); + } else if (input.charAt(0) === "0") { + output += "-----   "; + input = input.substring(1); + } else if (input.charAt(0) === "1") { + output += ".----   "; + input = input.substring(1); + } else if (input.charAt(0) === "2") { + output += "..---   "; + input = input.substring(1); + } else if (input.charAt(0) === "3") { + output += "...--   "; + input = input.substring(1); + } else if (input.charAt(0) === "4") { + output += "....-   "; + input = input.substring(1); + } else if (input.charAt(0) === "5") { + output += ".....   "; + input = input.substring(1); + } else if (input.charAt(0) === "6") { + output += "-....   "; + input = input.substring(1); + } else if (input.charAt(0) === "7") { + output += "--...   "; + input = input.substring(1); + } else if (input.charAt(0) === "8") { + output += "---..   "; + input = input.substring(1); + } else if (input.charAt(0) === "9") { + output += "----.   "; + input = input.substring(1); + } else if (input.charAt(0) === "Ä") { + output += ".-.-   "; + input = input.substring(1); + } else if (input.charAt(0) === "Ö") { + output += "---.   "; + input = input.substring(1); + } else if (input.charAt(0) === "Ü") { + output += "..--   "; + input = input.substring(1); + } else if (input.charAt(0) === "ß") { + output += "...--...   "; + input = input.substring(1); + } else if (input.charAt(0) === ".") { + output += ".-.-.-   "; + input = input.substring(1); + } else if (input.charAt(0) === ",") { + output += "--..--   "; + input = input.substring(1); + } else if (input.charAt(0) === ":") { + output += "---...   "; + input = input.substring(1); + } else if (input.charAt(0) === "") { + output += "-.-.-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "?") { + output += "..--..   "; + input = input.substring(1); + } else if (input.charAt(0) === "!") { + output += "-.-.--   "; + input = input.substring(1); + } else if (input.charAt(0) === "-") { + output += "-....-   "; + input = input.substring(1); + } else if (input.charAt(0) === "_") { + output += "..--.-   "; + input = input.substring(1); + } else if (input.charAt(0) === "(") { + output += "-.--.   "; + input = input.substring(1); + } else if (input.charAt(0) === ")") { + output += "-.--.-   "; + input = input.substring(1); + } else if (input.charAt(0) === "=") { + output += "-...-   "; + input = input.substring(1); + } else if (input.charAt(0) === "+") { + output += ".-.-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "/") { + output += "-..-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "@") { + output += ".--.-.   "; + input = input.substring(1); + } else if (input.charAt(0) === "'") { + output += ".----.   "; + input = input.substring(1); + } else if (input.charAt(0) === "$") { + output += "...-..-   "; + input = input.substring(1); + } else { + return "Code not listed or wrong."; + } + } + if (output.charAt(output.length - 1) === " ") { + output = output.substring(0, output.length - 1); + } + } + return output; +}; + +getNormalMorseEncoded = function(input) { + var d, inputToSign, output, sign, signFull; + if (!input) { + return null; + } + while (input.charAt(input.length - 1) === " ") { + input = input.substring(0, input.length - 1); + } + input = input.toUpperCase(); + while (input.charAt(input.length - 1) === "\n") { + input = input.substring(0, input.length - 1); + } + input += " "; + inputToSign = input; + output = ""; + while (inputToSign !== " ") { + d = 0; + signFull = true; + sign = ""; + while (signFull) { + if (inputToSign.substring(d, d + 7) === " " || inputToSign.substring(d, d + 3) === " " || inputToSign.charAt(0) === "\n") { + if (d === 0) { + if (inputToSign.substring(0, 7) === " ") { + output += " "; + inputToSign = inputToSign.substring(7, inputToSign.length); + } + if (inputToSign.substring(0, 3) === " ") { + inputToSign = inputToSign.substring(3, inputToSign.length); + } + if (inputToSign.charAt(0) === "\n") { + output += "
"; + inputToSign = inputToSign.substring(1, inputToSign.length); + } + } else { + sign = inputToSign.substring(0, d); + inputToSign = inputToSign.substring(d, inputToSign.length); + signFull = false; + } + } else { + d++; + } + } + if (sign === ".-") { + output += "A"; + } else if (sign === "-...") { + output += "B"; + } else if (sign === "-.-.") { + output += "C"; + } else if (sign === "-..") { + output += "D"; + } else if (sign === ".") { + output += "E"; + } else if (sign === "..-.") { + output += "F"; + } else if (sign === "--.") { + output += "G"; + } else if (sign === "....") { + output += "H"; + } else if (sign === "..") { + output += "I"; + } else if (sign === ".---") { + output += "J"; + } else if (sign === "-.-") { + output += "K"; + } else if (sign === ".-..") { + output += "L"; + } else if (sign === "--") { + output += "M"; + } else if (sign === "-.") { + output += "N"; + } else if (sign === "---") { + output += "O"; + } else if (sign === ".--.") { + output += "P"; + } else if (sign === "--.-") { + output += "Q"; + } else if (sign === ".-.") { + output += "R"; + } else if (sign === "...") { + output += "S"; + } else if (sign === "-") { + output += "T"; + } else if (sign === "..-") { + output += "U"; + } else if (sign === "...-") { + output += "V"; + } else if (sign === ".--") { + output += "W"; + } else if (sign === "-..-") { + output += "X"; + } else if (sign === "-.--") { + output += "Y"; + } else if (sign === "--..") { + output += "Z"; + } else if (sign === "-----") { + output += "0"; + } else if (sign === ".----") { + output += "1"; + } else if (sign === "..---") { + output += "2"; + } else if (sign === "...--") { + output += "3"; + } else if (sign === "....-") { + output += "4"; + } else if (sign === ".....") { + output += "5"; + } else if (sign === "-....") { + output += "6"; + } else if (sign === "--...") { + output += "7"; + } else if (sign === "---..") { + output += "8"; + } else if (sign === "----.") { + output += "9"; + } else if (sign === ".-.-") { + output += "Ä"; + } else if (sign === "---.") { + output += "Ö"; + } else if (sign === "..--") { + output += "Ü"; + } else if (sign === "...--...") { + output += "ß"; + } else if (sign === "----") { + output += "CH"; + } else if (sign === ".-.-.-") { + output += "."; + } else if (sign === "--..--") { + output += ","; + } else if (sign === "---...") { + output += ":"; + } else if (sign === "-.-.-.") { + output += ";"; + } else if (sign === "..--..") { + output += "?"; + } else if (sign === "-.-.--") { + output += "!"; + } else if (sign === "-....-") { + output += "-"; + } else if (sign === "..--.-") { + output += "_"; + } else if (sign === "-.--.") { + output += "("; + } else if (sign === "-.--.-") { + output += ")"; + } else if (sign === ".----.") { + output += "'"; + } else if (sign === "-...-") { + output += "="; + } else if (sign === ".-.-.") { + output += "+"; + } else if (sign === "-..-.") { + output += "/"; + } else if (sign === ".--.-.") { + output += "@"; + } else if (sign === "-.-.-") { + output += "Begin of the signal"; + } else if (sign === "-...-") { + output += "Wait"; + } else if (sign === "...-.") { + output += "Understood"; + } else if (sign === "...-.-") { + output += "End of work"; + } else if (sign === "...---...") { + output += "SOS"; + } else if (sign === "........") { + output += "Error"; + } else { + return "Code not listed or wrong."; + } + } + return output; +}; diff --git a/app/scripts/writtenMorseConvert.coffee b/app/scripts/writtenMorseConvert.coffee new file mode 100644 index 0000000..4c31555 --- /dev/null +++ b/app/scripts/writtenMorseConvert.coffee @@ -0,0 +1,523 @@ +getWrittenMorseDecoded = (input) -> + # Well, this shouldn't happen... + if !(input) + return null + + # remove trailing whitspaces + if input.charAt input.length is " " + input.substring 0, input.length - 1 + + input = input.toUpperCase() + output = "" + + # Return special signs + if input is "LETTERSPACE" + return "#" + else if input is "END OF WORK" + return "000101" + else if input is "ERROR" + return "00000000" + else if input is "STARTING SIGNAL" + return "10101" + else if input is "ENDING SIGNAL" + return "01010" + else if input is "UNDERSTOOD" + return "00010" + else if input is "WAIT" + return "01000" + else if input is "SOS" + return "000111000" + else if input is "LETTER SPACE" + return "#" + else if input is "WORD SPACE" + return "+" + else # the converting part + + while input.length > 0 + + if input.charAt(0) is " " + if output.charAt(output.length) is "#" + output = output.substring 0, output.length - 1 + output += "+" + input = input.substring 1 + + else if input.charAt(0) is "\n" + output += "
" + input = input.substring 1 + + else if input.charAt(0) is "A" + output += "01#" + input = input.substring 1 + + else if input.charAt(0) is "B" + output += "1000#" + input = input.substring 1 + + else if input.charAt(0) is "C" + output += "1010#" + input = input.substring 1 + + else if input.charAt(0) is "D" + output += "100#" + input = input.substring 1 + + else if input.charAt(0) is "E" + output += "0#" + input = input.substring 1 + + else if input.charAt(0) is "F" + output += "0010#" + input = input.substring 1 + + else if input.charAt(0) is "G" + output += "110#" + input = input.substring 1 + + else if input.charAt(0) is "H" + output += "0000#" + input = input.substring 1 + + else if input.charAt(0) is "I" + output += "00#" + input = input.substring 1 + + else if input.charAt(0) is "J" + output += "0111#" + input = input.substring 1 + + else if input.charAt(0) is "K" + output += "101#" + input = input.substring 1 + + else if input.charAt(0) is "L" + output += "0100#" + input = input.substring 1 + + else if input.charAt(0) is "M" + output += "11#" + input = input.substring 1 + + else if input.charAt(0) is "N" + output += "10#" + input = input.substring 1 + + else if input.charAt(0) is "O" + output += "111#" + input = input.substring 1 + + else if input.charAt(0) is "P" + output += "0110#" + input = input.substring 1 + + else if input.charAt(0) is "Q" + output += "1101#" + input = input.substring 1 + + else if input.charAt(0) is "R" + output += "010#" + input = input.substring 1 + + else if input.charAt(0) is "S" + output += "000#" + input = input.substring 1 + + else if input.charAt(0) is "T" + output += "1#" + input = input.substring 1 + + else if input.charAt(0) is "U" + output += "001#" + input = input.substring 1 + + else if input.charAt(0) is "V" + output += "0001#" + input = input.substring 1 + + else if input.charAt(0) is "W" + output += "011#" + input = input.substring 1 + + else if input.charAt(0) is "X" + output += "1001#" + input = input.substring 1 + + else if input.charAt(0) is "Y" + output += "1011#" + input = input.substring 1 + + else if input.charAt(0) is "Z" + output += "1100#" + input = input.substring 1 + + else if input.charAt(0) is "0" + output += "11111#" + input = input.substring 1 + + else if input.charAt(0) is "1" + output += "01111#" + input = input.substring 1 + + else if input.charAt(0) is "2" + output += "00111#" + input = input.substring 1 + + else if input.charAt(0) is "3" + output += "00011#" + input = input.substring 1 + + else if input.charAt(0) is "4" + output += "00001#" + input = input.substring 1 + + else if input.charAt(0) is "5" + output += "00000#" + input = input.substring 1 + + else if input.charAt(0) is "6" + output += "10000#" + input = input.substring 1 + + else if input.charAt(0) is "7" + output += "11000#" + input = input.substring 1 + + else if input.charAt(0) is "8" + output += "11100#" + input = input.substring 1 + + else if input.charAt(0) is "9" + output += "11110#" + input = input.substring 1 + + else if input.charAt(0) is "Ä" + output += "0101#" + input = input.substring 1 + + else if input.charAt(0) is "Ö" + output += "1110#" + input = input.substring 1 + + else if input.charAt(0) is "Ü" + output += "0011#" + input = input.substring 1 + + else if input.charAt(0) is "ß" + output += "00011000#" + input = input.substring 1 + + else if input.charAt(0) is "." + output += "010101#" + input = input.substring 1 + + else if input.charAt(0) is "," + output += "110011#" + input = input.substring 1 + + else if input.charAt(0) is ":" + output += "111000#" + input = input.substring 1 + + else if input.charAt(0) is "" + output += "101010#" + input = input.substring 1 + + else if input.charAt(0) is "?" + output += "001100#" + input = input.substring 1 + + else if input.charAt(0) is "!" + output += "101011#" + input = input.substring 1 + + else if input.charAt(0) is "-" + output += "100001#" + input = input.substring 1 + + else if input.charAt(0) is "_" + output += "001101#" + input = input.substring 1 + + else if input.charAt(0) is "(" + output += "10110#" + input = input.substring 1 + + else if input.charAt(0) is ")" + output += "101101#" + input = input.substring 1 + + else if input.charAt(0) is "=" + output += "10001#" + input = input.substring 1 + + else if input.charAt(0) is "+" + output += "01010#" + input = input.substring 1 + + else if input.charAt(0) is "/" + output += "10010#" + input = input.substring 1 + + else if input.charAt(0) is "@" + output += "011010#" + input = input.substring 1 + + else if input.charAt(0) is "'" + output += "011110#" + input = input.substring 1 + + else if input.charAt(0) is "$" + output += "0001001#" + input = input.substring 1 + + else + return "Code not listed or wrong." + + if output.charAt(output.length - 1) is "#" + output = output.substring 0, output.length - 1 + + return output + +getWrittenMorseEncoded = (input) -> + # Well, this shouldn't happen... + if !(input) then return null + + # remove trailing whitspaces + while input.charAt(input.length - 1) is " " + input = input.substring 0, input.length - 1 + + input = input.toUpperCase() + + while input.charAt(input.length - 1) is "#" or + input.charAt(input.length - 1) is "+" or + input.charAt(input.length - 1) is "\n" + input = input.substring 0, input.length - 1 + + if input.charAt(input.length - 1) isnt "#" + input += "#" + + inputToSign = input + output = "" + + while inputToSign isnt "#" + + d = 0 + signFull = true + sign = "" + + while signFull + + if inputToSign.charAt(d) is "+" or + inputToSign.charAt(d) is "#" or + inputToSign.charAt(0) is "\n" + + if d is 0 + + if inputToSign.charAt(0) is "+" + output += " " + inputToSign = inputToSign.substring 1, inputToSign.length + + if inputToSign.charAt(0) is "#" + inputToSign = inputToSign.substring 1, inputToSign.length + + if inputToSign.charAt(0) is "\n" + output += "
" + inputToSign = inputToSign.substring 1, inputToSign.length + + else + sign = inputToSign.substring 0, d + inputToSign = inputToSign.substring d, inputToSign.length + signFull = false + + else + d++ + + if sign is "01" + output += "A" + + else if sign is "1000" + output += "B" + + else if sign is "1010" + output += "C" + + else if sign is "100" + output += "D" + + else if sign is "0" + output += "E" + + else if sign is "0010" + output += "F" + + else if sign is "110" + output += "G" + + else if sign is "0000" + output += "H" + + else if sign is "00" + output += "I" + + else if sign is "0111" + output += "J" + + else if sign is "101" + output += "K" + + else if sign is "0100" + output += "L" + + else if sign is "11" + output += "M" + + else if sign is "10" + output += "N" + + else if sign is "111" + output += "O" + + else if sign is "0110" + output += "P" + + else if sign is "1101" + output += "Q" + + else if sign is "010" + output += "R" + + else if sign is "000" + output += "S" + + else if sign is "1" + output += "T" + + else if sign is "001" + output += "U" + + else if sign is "0001" + output += "V" + + else if sign is "011" + output += "W" + + else if sign is "1001" + output += "X" + + else if sign is "1011" + output += "Y" + + else if sign is "1100" + output += "Z" + + else if sign is "11111" + output += "0" + + else if sign is "01111" + output += "1" + + else if sign is "00111" + output += "2" + + else if sign is "00011" + output += "3" + + else if sign is "00001" + output += "4" + + else if sign is "00000" + output += "5" + + else if sign is "10000" + output += "6" + + else if sign is "11000" + output += "7" + + else if sign is "11100" + output += "8" + + else if sign is "11110" + output += "9" + + else if sign is "0101" + output += "Ä" + + else if sign is "1110" + output += "Ö" + + else if sign is "0011" + output += "Ü" + + else if sign is "00011000" + output += "ß" + + else if sign is "1111" + output += "CH" + + else if sign is "010101" + output += "." + + else if sign is "110011" + output += "," + + else if sign is "111000" + output += ":" + + else if sign is "101010" + output += ";" + + else if sign is "001100" + output += "?" + + else if sign is "101011" + output += "!" + + else if sign is "100001" + output += "-" + + else if sign is "001101" + output += "_" + + else if sign is "10110" + output += "(" + + else if sign is "101101" + output += ")" + + else if sign is "011110" + output += "'" + + else if sign is "10001" + output += "=" + + else if sign is "01010" + output += "+" + + else if sign is "10010" + output += "/" + + else if sign is "011010" + output += "@" + + else if sign is "10101" + output += "Begin of the signal" + + else if sign is "10001" + output += "Wait" + + else if sign is "00010" + output += "Understood" + + else if sign is "000101" + output += "End of work" + + else if sign is "000111000" + output += "SOS" + + else if sign is "00000000" + output += "Error" + + else + return "Code not listed or wrong." + + return output diff --git a/app/scripts/writtenMorseConvert.js b/app/scripts/writtenMorseConvert.js new file mode 100644 index 0000000..9d5e9d8 --- /dev/null +++ b/app/scripts/writtenMorseConvert.js @@ -0,0 +1,396 @@ +var getWrittenMorseDecoded, getWrittenMorseEncoded; + +getWrittenMorseDecoded = function(input) { + var output; + if (!input) { + return null; + } + if (input.charAt(input.length === " ")) { + input.substring(0, input.length - 1); + } + input = input.toUpperCase(); + output = ""; + if (input === "LETTERSPACE") { + return "#"; + } else if (input === "END OF WORK") { + return "000101"; + } else if (input === "ERROR") { + return "00000000"; + } else if (input === "STARTING SIGNAL") { + return "10101"; + } else if (input === "ENDING SIGNAL") { + return "01010"; + } else if (input === "UNDERSTOOD") { + return "00010"; + } else if (input === "WAIT") { + return "01000"; + } else if (input === "SOS") { + return "000111000"; + } else if (input === "LETTER SPACE") { + return "#"; + } else if (input === "WORD SPACE") { + return "+"; + } else { + while (input.length > 0) { + if (input.charAt(0) === " ") { + if (output.charAt(output.length) === "#") { + output = output.substring(0, output.length - 1); + } + output += "+"; + input = input.substring(1); + } else if (input.charAt(0) === "\n") { + output += "
"; + input = input.substring(1); + } else if (input.charAt(0) === "A") { + output += "01#"; + input = input.substring(1); + } else if (input.charAt(0) === "B") { + output += "1000#"; + input = input.substring(1); + } else if (input.charAt(0) === "C") { + output += "1010#"; + input = input.substring(1); + } else if (input.charAt(0) === "D") { + output += "100#"; + input = input.substring(1); + } else if (input.charAt(0) === "E") { + output += "0#"; + input = input.substring(1); + } else if (input.charAt(0) === "F") { + output += "0010#"; + input = input.substring(1); + } else if (input.charAt(0) === "G") { + output += "110#"; + input = input.substring(1); + } else if (input.charAt(0) === "H") { + output += "0000#"; + input = input.substring(1); + } else if (input.charAt(0) === "I") { + output += "00#"; + input = input.substring(1); + } else if (input.charAt(0) === "J") { + output += "0111#"; + input = input.substring(1); + } else if (input.charAt(0) === "K") { + output += "101#"; + input = input.substring(1); + } else if (input.charAt(0) === "L") { + output += "0100#"; + input = input.substring(1); + } else if (input.charAt(0) === "M") { + output += "11#"; + input = input.substring(1); + } else if (input.charAt(0) === "N") { + output += "10#"; + input = input.substring(1); + } else if (input.charAt(0) === "O") { + output += "111#"; + input = input.substring(1); + } else if (input.charAt(0) === "P") { + output += "0110#"; + input = input.substring(1); + } else if (input.charAt(0) === "Q") { + output += "1101#"; + input = input.substring(1); + } else if (input.charAt(0) === "R") { + output += "010#"; + input = input.substring(1); + } else if (input.charAt(0) === "S") { + output += "000#"; + input = input.substring(1); + } else if (input.charAt(0) === "T") { + output += "1#"; + input = input.substring(1); + } else if (input.charAt(0) === "U") { + output += "001#"; + input = input.substring(1); + } else if (input.charAt(0) === "V") { + output += "0001#"; + input = input.substring(1); + } else if (input.charAt(0) === "W") { + output += "011#"; + input = input.substring(1); + } else if (input.charAt(0) === "X") { + output += "1001#"; + input = input.substring(1); + } else if (input.charAt(0) === "Y") { + output += "1011#"; + input = input.substring(1); + } else if (input.charAt(0) === "Z") { + output += "1100#"; + input = input.substring(1); + } else if (input.charAt(0) === "0") { + output += "11111#"; + input = input.substring(1); + } else if (input.charAt(0) === "1") { + output += "01111#"; + input = input.substring(1); + } else if (input.charAt(0) === "2") { + output += "00111#"; + input = input.substring(1); + } else if (input.charAt(0) === "3") { + output += "00011#"; + input = input.substring(1); + } else if (input.charAt(0) === "4") { + output += "00001#"; + input = input.substring(1); + } else if (input.charAt(0) === "5") { + output += "00000#"; + input = input.substring(1); + } else if (input.charAt(0) === "6") { + output += "10000#"; + input = input.substring(1); + } else if (input.charAt(0) === "7") { + output += "11000#"; + input = input.substring(1); + } else if (input.charAt(0) === "8") { + output += "11100#"; + input = input.substring(1); + } else if (input.charAt(0) === "9") { + output += "11110#"; + input = input.substring(1); + } else if (input.charAt(0) === "Ä") { + output += "0101#"; + input = input.substring(1); + } else if (input.charAt(0) === "Ö") { + output += "1110#"; + input = input.substring(1); + } else if (input.charAt(0) === "Ü") { + output += "0011#"; + input = input.substring(1); + } else if (input.charAt(0) === "ß") { + output += "00011000#"; + input = input.substring(1); + } else if (input.charAt(0) === ".") { + output += "010101#"; + input = input.substring(1); + } else if (input.charAt(0) === ",") { + output += "110011#"; + input = input.substring(1); + } else if (input.charAt(0) === ":") { + output += "111000#"; + input = input.substring(1); + } else if (input.charAt(0) === "") { + output += "101010#"; + input = input.substring(1); + } else if (input.charAt(0) === "?") { + output += "001100#"; + input = input.substring(1); + } else if (input.charAt(0) === "!") { + output += "101011#"; + input = input.substring(1); + } else if (input.charAt(0) === "-") { + output += "100001#"; + input = input.substring(1); + } else if (input.charAt(0) === "_") { + output += "001101#"; + input = input.substring(1); + } else if (input.charAt(0) === "(") { + output += "10110#"; + input = input.substring(1); + } else if (input.charAt(0) === ")") { + output += "101101#"; + input = input.substring(1); + } else if (input.charAt(0) === "=") { + output += "10001#"; + input = input.substring(1); + } else if (input.charAt(0) === "+") { + output += "01010#"; + input = input.substring(1); + } else if (input.charAt(0) === "/") { + output += "10010#"; + input = input.substring(1); + } else if (input.charAt(0) === "@") { + output += "011010#"; + input = input.substring(1); + } else if (input.charAt(0) === "'") { + output += "011110#"; + input = input.substring(1); + } else if (input.charAt(0) === "$") { + output += "0001001#"; + input = input.substring(1); + } else { + return "Code not listed or wrong."; + } + } + if (output.charAt(output.length - 1) === "#") { + output = output.substring(0, output.length - 1); + } + } + return output; +}; + +getWrittenMorseEncoded = function(input) { + var d, inputToSign, output, sign, signFull; + if (!input) { + return null; + } + while (input.charAt(input.length - 1) === " ") { + input = input.substring(0, input.length - 1); + } + input = input.toUpperCase(); + while (input.charAt(input.length - 1) === "#" || input.charAt(input.length - 1) === "+" || input.charAt(input.length - 1) === "\n") { + input = input.substring(0, input.length - 1); + } + if (input.charAt(input.length - 1) !== "#") { + input += "#"; + } + inputToSign = input; + output = ""; + while (inputToSign !== "#") { + d = 0; + signFull = true; + sign = ""; + while (signFull) { + if (inputToSign.charAt(d) === "+" || inputToSign.charAt(d) === "#" || inputToSign.charAt(0) === "\n") { + if (d === 0) { + if (inputToSign.charAt(0) === "+") { + output += " "; + inputToSign = inputToSign.substring(1, inputToSign.length); + } + if (inputToSign.charAt(0) === "#") { + inputToSign = inputToSign.substring(1, inputToSign.length); + } + if (inputToSign.charAt(0) === "\n") { + output += "
"; + inputToSign = inputToSign.substring(1, inputToSign.length); + } + } else { + sign = inputToSign.substring(0, d); + inputToSign = inputToSign.substring(d, inputToSign.length); + signFull = false; + } + } else { + d++; + } + } + if (sign === "01") { + output += "A"; + } else if (sign === "1000") { + output += "B"; + } else if (sign === "1010") { + output += "C"; + } else if (sign === "100") { + output += "D"; + } else if (sign === "0") { + output += "E"; + } else if (sign === "0010") { + output += "F"; + } else if (sign === "110") { + output += "G"; + } else if (sign === "0000") { + output += "H"; + } else if (sign === "00") { + output += "I"; + } else if (sign === "0111") { + output += "J"; + } else if (sign === "101") { + output += "K"; + } else if (sign === "0100") { + output += "L"; + } else if (sign === "11") { + output += "M"; + } else if (sign === "10") { + output += "N"; + } else if (sign === "111") { + output += "O"; + } else if (sign === "0110") { + output += "P"; + } else if (sign === "1101") { + output += "Q"; + } else if (sign === "010") { + output += "R"; + } else if (sign === "000") { + output += "S"; + } else if (sign === "1") { + output += "T"; + } else if (sign === "001") { + output += "U"; + } else if (sign === "0001") { + output += "V"; + } else if (sign === "011") { + output += "W"; + } else if (sign === "1001") { + output += "X"; + } else if (sign === "1011") { + output += "Y"; + } else if (sign === "1100") { + output += "Z"; + } else if (sign === "11111") { + output += "0"; + } else if (sign === "01111") { + output += "1"; + } else if (sign === "00111") { + output += "2"; + } else if (sign === "00011") { + output += "3"; + } else if (sign === "00001") { + output += "4"; + } else if (sign === "00000") { + output += "5"; + } else if (sign === "10000") { + output += "6"; + } else if (sign === "11000") { + output += "7"; + } else if (sign === "11100") { + output += "8"; + } else if (sign === "11110") { + output += "9"; + } else if (sign === "0101") { + output += "Ä"; + } else if (sign === "1110") { + output += "Ö"; + } else if (sign === "0011") { + output += "Ü"; + } else if (sign === "00011000") { + output += "ß"; + } else if (sign === "1111") { + output += "CH"; + } else if (sign === "010101") { + output += "."; + } else if (sign === "110011") { + output += ","; + } else if (sign === "111000") { + output += ":"; + } else if (sign === "101010") { + output += ";"; + } else if (sign === "001100") { + output += "?"; + } else if (sign === "101011") { + output += "!"; + } else if (sign === "100001") { + output += "-"; + } else if (sign === "001101") { + output += "_"; + } else if (sign === "10110") { + output += "("; + } else if (sign === "101101") { + output += ")"; + } else if (sign === "011110") { + output += "'"; + } else if (sign === "10001") { + output += "="; + } else if (sign === "01010") { + output += "+"; + } else if (sign === "10010") { + output += "/"; + } else if (sign === "011010") { + output += "@"; + } else if (sign === "10101") { + output += "Begin of the signal"; + } else if (sign === "10001") { + output += "Wait"; + } else if (sign === "00010") { + output += "Understood"; + } else if (sign === "000101") { + output += "End of work"; + } else if (sign === "000111000") { + output += "SOS"; + } else if (sign === "00000000") { + output += "Error"; + } else { + return "Code not listed or wrong."; + } + } + return output; +}; diff --git a/app/sw-import.js b/app/sw-import.js new file mode 100644 index 0000000..f3a1a00 --- /dev/null +++ b/app/sw-import.js @@ -0,0 +1 @@ +importScripts('bower_components/platinum-sw/service-worker.js'); diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..10d80b9 --- /dev/null +++ b/bower.json @@ -0,0 +1,35 @@ +{ + "name": "Morse Converter (beta)", + "version": "0.2.0", + "homepage": "https://github.com/mmk2410/morse-converter-web", + "authors": [ + "mmk2410 " + ], + "description": "A writtenMorse and Morse Converter for the web", + "keywords": [ + "morse", + "writtenmorse" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "iron-input": "PolymerElements/iron-input#~1.0.5", + "paper-drawer-panel": "PolymerElements/paper-drawer-panel#~1.0.3", + "paper-header-panel": "PolymerElements/paper-header-panel#~1.0.5", + "paper-icon-button": "PolymerElements/paper-icon-button#~1.0.3", + "paper-input": "PolymerElements/paper-input#~1.0.12", + "paper-item": "PolymerElements/paper-item#~1.0.2", + "paper-material": "PolymerElements/paper-material#~1.0.2", + "paper-menu": "PolymerElements/paper-menu#~1.1.0", + "paper-toast": "PolymerElements/paper-toast#~1.0.0", + "paper-toolbar": "PolymerElements/paper-toolbar#~1.0.4", + "platinum-sw": "PolymerElements/platinum-sw#~1.2.0", + "polymer": "Polymer/polymer#^1.0.0" + } +} diff --git a/gulpfile.coffee b/gulpfile.coffee new file mode 100644 index 0000000..0c81dbc --- /dev/null +++ b/gulpfile.coffee @@ -0,0 +1,108 @@ +gulp = require 'gulp' +coffee = require 'gulp-coffee' +gutil = require 'gulp-util' +gloadplug = require 'gulp-load-plugins' +$ = gloadplug() +del = require 'del' +runSequence = require 'run-sequence' +merge = require 'merge-stream' +path = require 'path' +fs = require 'fs' +glob = require 'glob' + + +gulp.task 'coffee', () -> + gulp.src 'app/scripts/*.coffee' + .pipe coffee({bare: true}).on 'error', gutil.log + .pipe gulp.dest 'app/scripts/' + +gulp.task 'images', () -> + gulp.src 'app/images/**/*' + .pipe $.cache $.imagemin { + progressive: true + interlaced: true + } + .pipe gulp.dest 'dist/images' + .pipe $.size {title: 'images'} + +gulp.task 'copy', () -> + app = gulp.src([ + 'app/*', + '!app/precache.json' + ], { + dot: true + }).pipe gulp.dest 'dist' + + bower = gulp.src([ + 'bower_components/**/*' + ]).pipe gulp.dest 'dist/bower_components' + + elements = gulp.src([ + 'app/elements/**/*.html' + ]).pipe gulp.dest 'dist/elements' + + swBootstrap = gulp.src ['bower_components/platinum-sw/bootstrap/*.js'] + .pipe gulp.dest 'dist/elements/bootstrap' + + swToolbox = gulp.src ['bower_components/sw-toolbox/*.js'] + .pipe gulp.dest 'dist/sw-toolbox' + + vulcanized = gulp.src ['app/elements/elements.html'] + .pipe $.rename 'elements.vulcanized.html' + .pipe gulp.dest 'dist/elements' + + merge(app, bower, elements, vulcanized, swBootstrap, swToolbox) + .pipe $.size {title: 'copy'} + +gulp.task 'html', () -> + assets = $.useref.assets {searchPath: ['app', 'dist']} + + gulp.src ['app/**/*.html', '!app/elements/**/*.html'] + .pipe $.if '*.html', $.replace 'elements/elements.html', + 'elements/elements.vulcanized.html' + .pipe assets + .pipe $.if '*.js', $.uglify() + .pipe assets.restore() + .pipe $.useref() + .pipe $.if '*.html', $.minifyHtml { + quotes: true + empty: true + spare: true + } + .pipe gulp.dest 'dist' + .pipe $.size {title: 'html'} + +gulp.task 'vulcanize', () -> + DEST_DIR = 'dist/elements' + + gulp.src 'dist/elements/elements.vulcanized.html' + .pipe $.vulcanize { + dest: DEST_DIR + strip: true + inlineCss: true + inlineScripts: true + } + .pipe gulp.dest DEST_DIR + .pipe $.size {title: 'vulcanize'} + +gulp.task 'precache', (callback) -> + dir = 'dist' + + glob '{elements,scripts}/**/*.*', {cwd: dir}, (error, files) -> + if error then callback error + else + files.push 'index.html', './', + 'bower_components/webcomponentsjs/webcomponents.min.js' + filePath = path.join dir, 'precache.json' + fs.writeFile filePath, JSON.stringify(files), callback + +gulp.task 'clean', del.bind null, ['dist'] + +gulp.task 'default', ['clean'], (cb) -> + runSequence 'coffee', 'copy', + ['images', 'html'], + 'vulcanize', 'precache', cb + +try + require('require-dir')('tasks') +catch err diff --git a/index.html b/index.html deleted file mode 100644 index d2935e1..0000000 --- a/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - Morse Converter - - - - - - - - - - - - - - - - - - - - Morse Converter Alpha - -
- -
writtenMorse
-
Normal Morse
-
-
Report a Bug
-
-
About
-
-
-
- -
-
- ENCRYPT - DECRYPT -
-
-
-
- -
-
-
- - diff --git a/js/engine/DecryptNormalMorse.js b/js/engine/DecryptNormalMorse.js deleted file mode 100644 index 3d91d2c..0000000 --- a/js/engine/DecryptNormalMorse.js +++ /dev/null @@ -1,171 +0,0 @@ -function decryptNormalMorseManager(inputMessage) { - if(inputMessage === ""){ - return "Please enter at least one character"; - } else { - if (inputMessage.endsWith(" ")) { - inputMessage = inputMessage.substring(0, message.length() - 1); - } - // Variables - var input = inputMessage.toUpperCase(); - if(input.endsWith(' ') == false){ - input = input + " "; - } - while(input.indexOf('\n') != -1){ - input = input.replace("\n","") - } - var inputToSign = input; - var output = ""; - var d = 0; - while ((inputToSign != ' ')) { - d = 0; - var signFull = true; - var sign = ""; - while (signFull) { - if (inputToSign.substring(d, d + 7) == ' '|| inputToSign.substring(d, d + 3) == ' ') { - if (d === 0) { - if (inputToSign.startsWith(" ")) { - output = output + " "; - inputToSign = inputToSign.substring(7, inputToSign.length); - } else { - inputToSign = inputToSign.substring(3, inputToSign.length); - } - } else { - sign = inputToSign.substring(0, d); - inputToSign = inputToSign.substring(d, inputToSign.length); - signFull = false; - } - } else { - d = d + 1; - } - } - if (sign == ".-") { - output = output + "A"; - } else if (sign == "-...") { - output = output + "B"; - } else if (sign == "-.-.") { - output = output + "C"; - } else if (sign == "-..") { - output = output + "D"; - } else if (sign == ".") { - output = output + "E"; - } else if (sign == "..-.") { - output = output + "F"; - } else if (sign == "--.") { - output = output + "G"; - } else if (sign == "....") { - output = output + "H"; - } else if (sign == "..") { - output = output + "I"; - } else if (sign == ".---") { - output = output + "J"; - } else if (sign == "-.-") { - output = output + "K"; - } else if (sign == ".-..") { - output = output + "L"; - } else if (sign == "--") { - output = output + "M"; - } else if (sign == "-.") { - output = output + "N"; - } else if (sign == "---") { - output = output + "O"; - } else if (sign == ".--.") { - output = output + "P"; - } else if (sign == "--.-") { - output = output + "Q"; - } else if (sign == ".-.") { - output = output + "R"; - } else if (sign == "...") { - output = output + "S"; - } else if (sign == "-") { - output = output + "T"; - } else if (sign == "..-") { - output = output + "U"; - } else if (sign == "...-") { - output = output + "V"; - } else if (sign == ".--") { - output = output + "W"; - } else if (sign == "-..-") { - output = output + "X"; - } else if (sign == "-.--") { - output = output + "Y"; - } else if (sign == "--..") { - output = output + "Z"; - } else if (sign == "-----") { - output = output + ". (zero)"; - } else if (sign == ".----") { - output = output + "-"; - } else if (sign == "..---") { - output = output + "2"; - } else if (sign == "...--") { - output = output + "3"; - } else if (sign == "....-") { - output = output + "4"; - } else if (sign == ".....") { - output = output + "5"; - } else if (sign == "-....") { - output = output + "6"; - } else if (sign == "--...") { - output = output + "7"; - } else if (sign == "---..") { - output = output + "8"; - } else if (sign == "----.") { - output = output + "9"; - } else if (sign == ".-.-") { - output = output + "Ä"; - } else if (sign == "---.") { - output = output + "Ö"; - } else if (sign == "..--") { - output = output + "Ü"; - } else if (sign == "...--...") { - output = output + "ß"; - } else if (sign == "----") { - output = output + "CH"; - } else if (sign == ".-.-.-") { - output = output + "."; - } else if (sign == "--..--") { - output = output + ","; - } else if (sign == "---...") { - output = output + ":"; - } else if (sign == "-.-.-.") { - output = output + ";"; - } else if (sign == "..--..") { - output = output + "?"; - } else if (sign == "-.-.--") { - output = output + "!"; - } else if (sign == "-....-") { - output = output + "-"; - } else if (sign == "..--.-") { - output = output + "_"; - } else if (sign == "-.--.") { - output = output + "("; - } else if (sign == "-.--.-") { - output = output + ")"; - } else if (sign == ".----.") { - output = output + "'"; - } else if (sign == "-...-") { - output = output + "="; - } else if (sign == ".-.-.") { - output = output + "+ or End of the signal"; - } else if (sign == "-..-.") { - output = output + "/"; - } else if (sign == ".--.-.") { - output = output + "@"; - } else if (sign == "-.-.-") { - output = output + "Begin of the signal"; - } else if (sign == "-...-") { - output = output + "Wait"; - } else if (sign == "...-.") { - output = output + "Understood"; - } else if (sign == "...-.-") { - output = output + "End of work"; - } else if (sign == "...---...") { - output = output + "SOS"; - } else if (sign == "........") { - output = output + "Error"; - } else { - output = "Code not listed or wrong."; - } - } - return output; - } -} diff --git a/js/engine/DecryptWrittenMorse.js b/js/engine/DecryptWrittenMorse.js deleted file mode 100644 index 7551c70..0000000 --- a/js/engine/DecryptWrittenMorse.js +++ /dev/null @@ -1,169 +0,0 @@ -function decryptWrittenMorseManager(inputMessage) { - if(inputMessage === ""){ - return "Please enter at least one character"; - } else { - if (inputMessage.endsWith(" ")) { - inputMessage = inputMessage.substring(0, message.length() - 1); - } - // Variables - var input = inputMessage.toUpperCase(); - if(input.endsWith('#') == false){ - input = input + "#"; - } - while(input.indexOf('\n') != -1){ - input = input.replace("\n","") - } - var inputToSign = input; - var output = ""; - var d = 0; - while ((inputToSign != '#')) { - d = 0; - var signFull = true; - var sign = ""; - while (signFull) { - if (inputToSign.charAt(d) == '+'|| inputToSign.charAt(d) == '#') { - if (d === 0) { - if (inputToSign.startsWith("+")) { - output = output + " "; - } - inputToSign = inputToSign.substring(1, inputToSign.length); - } else { - sign = inputToSign.substring(0, d); - inputToSign = inputToSign.substring(d, inputToSign.length); - signFull = false; - } - } else { - d = d + 1; - } - } - if (sign == "01") { - output = output + "A"; - } else if (sign == "1000") { - output = output + "B"; - } else if (sign == "1010") { - output = output + "C"; - } else if (sign == "100") { - output = output + "D"; - } else if (sign == "0") { - output = output + "E"; - } else if (sign == "0010") { - output = output + "F"; - } else if (sign == "110") { - output = output + "G"; - } else if (sign == "0000") { - output = output + "H"; - } else if (sign == "00") { - output = output + "I"; - } else if (sign == "0111") { - output = output + "J"; - } else if (sign == "101") { - output = output + "K"; - } else if (sign == "0100") { - output = output + "L"; - } else if (sign == "11") { - output = output + "M"; - } else if (sign == "10") { - output = output + "N"; - } else if (sign == "111") { - output = output + "O"; - } else if (sign == "0110") { - output = output + "P"; - } else if (sign == "1101") { - output = output + "Q"; - } else if (sign == "010") { - output = output + "R"; - } else if (sign == "000") { - output = output + "S"; - } else if (sign == "1") { - output = output + "T"; - } else if (sign == "001") { - output = output + "U"; - } else if (sign == "0001") { - output = output + "V"; - } else if (sign == "011") { - output = output + "W"; - } else if (sign == "1001") { - output = output + "X"; - } else if (sign == "1011") { - output = output + "Y"; - } else if (sign == "1100") { - output = output + "Z"; - } else if (sign == "11111") { - output = output + "0 (zero)"; - } else if (sign == "01111") { - output = output + "1"; - } else if (sign == "00111") { - output = output + "2"; - } else if (sign == "00011") { - output = output + "3"; - } else if (sign == "00001") { - output = output + "4"; - } else if (sign == "00000") { - output = output + "5"; - } else if (sign == "10000") { - output = output + "6"; - } else if (sign == "11000") { - output = output + "7"; - } else if (sign == "11100") { - output = output + "8"; - } else if (sign == "11110") { - output = output + "9"; - } else if (sign == "0101") { - output = output + "Ä"; - } else if (sign == "1110") { - output = output + "Ö"; - } else if (sign == "0011") { - output = output + "Ü"; - } else if (sign == "00011000") { - output = output + "ß"; - } else if (sign == "1111") { - output = output + "CH"; - } else if (sign == "010101") { - output = output + "."; - } else if (sign == "110011") { - output = output + ","; - } else if (sign == "111000") { - output = output + ":"; - } else if (sign == "101010") { - output = output + ";"; - } else if (sign == "001100") { - output = output + "?"; - } else if (sign == "101011") { - output = output + "!"; - } else if (sign == "100001") { - output = output + "-"; - } else if (sign == "001101") { - output = output + "_"; - } else if (sign == "10110") { - output = output + "("; - } else if (sign == "101101") { - output = output + ")"; - } else if (sign == "011110") { - output = output + "'"; - } else if (sign == "10001") { - output = output + "="; - } else if (sign == "01010") { - output = output + "+ or End of the signal"; - } else if (sign == "10010") { - output = output + "/"; - } else if (sign == "011010") { - output = output + "@"; - } else if (sign == "10101") { - output = output + "Begin of the signal"; - } else if (sign == "10001") { - output = output + "Wait"; - } else if (sign == "00010") { - output = output + "Understood"; - } else if (sign == "000101") { - output = output + "End of work"; - } else if (sign == "000111000") { - output = output + "SOS"; - } else if (sign == "00000000") { - output = output + "Error"; - } else { - output = "Code not listed or wrong."; - } - } - return output; - } -} diff --git a/js/engine/EncryptNormalMorse.js b/js/engine/EncryptNormalMorse.js deleted file mode 100644 index df37ffc..0000000 --- a/js/engine/EncryptNormalMorse.js +++ /dev/null @@ -1,220 +0,0 @@ -function encryptNormalMorseManager(message) { - if(message == ""){ - return "Please enter at least one character" - } else { - if (message.endsWith(" ")) { - message = message.substring(0, message.length - 3) - } - // Variables - var input = message.toUpperCase() - while(input.indexOf('\n') != -1){ - input = input.replace("\n","") - } - var output = "" - if (input == "LETTERSPACE") { - output = " " - } else if (input == "END OF WORK") { - output = "...-.-" - } else if (input == "ERROR") { - output = "........" - } else if (input == "STARTING SIGNAL") { - output = "-.-.-" - } else if (input == "ENDING SIGNAL") { - output = ".-.-." - } else if (input == "UNDERSTOOD") { - output = "...-." - } else if (input == "WAIT") { - output = ".-..." - } else if (input == "SOS") { - output = "...---..." - } else if (input == "LETTER SPACE") { - output = " " - } else if (input == "WORD SPACE") { - output = " " - } else { - for (var c = input.length; c > 0; c--) { - if (input.startsWith(" ")) { - if (output.endsWith(" ")) { - output = output.substring(0, output.length - 3) - } - output = output + "       " - input = input.substring(1, input.length) - } else if (input.startsWith("A")) { - output = output + ".-   " - input = input.substring(1, input.length) - } else if (input.startsWith("B")) { - output = output +"-...   " - input = input.substring(1, input.length) - } else if (input.startsWith("C")) { - output = output +"-.-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("D")) { - output = output +"-..   " - input = input.substring(1, input.length) - } else if (input.startsWith("E")) { - output = output +".   " - input = input.substring(1, input.length) - } else if (input.startsWith("F")) { - output = output +"..-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("G")) { - output = output +"--.   " - input = input.substring(1, input.length) - } else if (input.startsWith("H")) { - output = output +"....   " - input = input.substring(1, input.length) - } else if (input.startsWith("I")) { - output = output +"..   " - input = input.substring(1, input.length) - } else if (input.startsWith("J")) { - output = output +".---   " - input = input.substring(1, input.length) - } else if (input.startsWith("K")) { - output = output +"-.-   " - input = input.substring(1, input.length) - } else if (input.startsWith("L")) { - output = output +".-..   " - input = input.substring(1, input.length) - } else if (input.startsWith("M")) { - output = output +"--   " - input = input.substring(1, input.length) - } else if (input.startsWith("N")) { - output = output +"-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("O")) { - output = output +"---   " - input = input.substring(1, input.length) - } else if (input.startsWith("P")) { - output = output +".--.   " - input = input.substring(1, input.length) - } else if (input.startsWith("Q")) { - output = output +"--.-   " - input = input.substring(1, input.length) - } else if (input.startsWith("R")) { - output = output +".-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("S")) { - output = output +"...   " - input = input.substring(1, input.length) - } else if (input.startsWith("T")) { - output = output +"-   " - input = input.substring(1, input.length) - } else if (input.startsWith("U")) { - output = output +"..-   " - input = input.substring(1, input.length) - } else if (input.startsWith("V")) { - output = output +"...-   " - input = input.substring(1, input.length) - } else if (input.startsWith("W")) { - output = output +".--   " - input = input.substring(1, input.length) - } else if (input.startsWith("X")) { - output = output +"-..-   " - input = input.substring(1, input.length) - } else if (input.startsWith("Y")) { - output = output +"-.--   " - input = input.substring(1, input.length) - } else if (input.startsWith("Z")) { - output = output +"--..   " - input = input.substring(1, input.length) - } else if (input.startsWith("0")) { - output = output +"-----   " - input = input.substring(1, input.length) - } else if (input.startsWith("1")) { - output = output +".----   " - input = input.substring(1, input.length) - } else if (input.startsWith("2")) { - output = output +"..---   " - input = input.substring(1, input.length) - } else if (input.startsWith("3")) { - output = output +"...--   " - input = input.substring(1, input.length) - } else if (input.startsWith("4")) { - output = output +"....-   " - input = input.substring(1, input.length) - } else if (input.startsWith("5")) { - output = output +".....   " - input = input.substring(1, input.length) - } else if (input.startsWith("6")) { - output = output +"-....   " - input = input.substring(1, input.length) - } else if (input.startsWith("7")) { - output = output +"--...   " - input = input.substring(1, input.length) - } else if (input.startsWith("8")) { - output = output +"---..   " - input = input.substring(1, input.length) - } else if (input.startsWith("9")) { - output = output +"----.   " - input = input.substring(1, input.length) - } else if (input.startsWith("Ä")) { - output = output +".-.-   " - input = input.substring(1, input.length) - } else if (input.startsWith("Ö")) { - output = output +"---.   " - input = input.substring(1, input.length) - } else if (input.startsWith("Ü")) { - output = output +"..--   " - input = input.substring(1, input.length) - } else if (input.startsWith("ß")) { - output = output +"...--...   " - input = input.substring(1, input.length) - } else if (input.startsWith(".")) { - output = output +".-.-.-   " - input = input.substring(1, input.length) - } else if (input.startsWith(",")) { - output = output +"--..--   " - input = input.substring(1, input.length) - } else if (input.startsWith(":")) { - output = output +"---...   " - input = input.substring(1, input.length) - } else if (input.startsWith(";")) { - output = output +"-.-.-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("?")) { - output = output +"..--..   " - input = input.substring(1, input.length) - } else if (input.startsWith("!")) { - output = output +"-.-.--   " - input = input.substring(1, input.length) - } else if (input.startsWith("-")) { - output = output +"-....-   " - input = input.substring(1, input.length) - } else if (input.startsWith("_")) { - output = output +"..--.-   " - input = input.substring(1, input.length) - } else if (input.startsWith("(")) { - output = output +"-.--.   " - input = input.substring(1, input.length) - } else if (input.startsWith(")")) { - output = output +"-.--.-   " - input = input.substring(1, input.length) - } else if (input.startsWith("=")) { - output = output +"-...-   " - input = input.substring(1, input.length) - } else if (input.startsWith("+")) { - output = output +".-.-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("/")) { - output = output +"-..-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("@")) { - output = output +".--.-.   " - input = input.substring(1, input.length) - } else if (input.startsWith("'")) { - output = output +".----.   " - input = input.substring(1, input.length) - } else if (input.startsWith("$")) { - output = output +"...-..-   " - input = input.substring(1, input.length) - } else { - output = "Code not listed or wrong." - } - } - if (output.endsWith("   ")) { - output = output.substring(0, output.length - 18) - } - } - return output - } -} diff --git a/js/engine/EncryptWrittenMorse.js b/js/engine/EncryptWrittenMorse.js deleted file mode 100644 index 6da01b5..0000000 --- a/js/engine/EncryptWrittenMorse.js +++ /dev/null @@ -1,220 +0,0 @@ -function encryptWrittenMorseManager(message) { - if(message == ""){ - return "Please enter at least one character" - } else { - if (message.endsWith(" ")) { - message = message.substring(0, message.length - 1) - } - // Variables - var input = message.toUpperCase() - while(input.indexOf('\n') != -1){ - input = input.replace("\n","") - } - var output = "" - if (input == "LETTERSPACE") { - output = "#" - } else if (input == "END OF WORK") { - output = "000101" - } else if (input == "ERROR") { - output = "00000000" - } else if (input == "STARTING SIGNAL") { - output = "10101" - } else if (input == "ENDING SIGNAL") { - output = "01010" - } else if (input == "UNDERSTOOD") { - output = "00010" - } else if (input == "WAIT") { - output = "01000" - } else if (input == "SOS") { - output = "000111000" - } else if (input == "LETTER SPACE") { - output = "##" - } else if (input == "WORD SPACE") { - output = "+" - } else { - for (var c = input.length; c > 0; c--) { - if (input.startsWith(" ")) { - if (output.endsWith("#")) { - output = output.substring(0, output.length - 1) - } - output = output +"+" - input = input.substring(1, input.length) - } else if (input.startsWith("A")) { - output = output + "01#" - input = input.substring(1, input.length) - } else if (input.startsWith("B")) { - output = output +"1000#" - input = input.substring(1, input.length) - } else if (input.startsWith("C")) { - output = output +"1010#" - input = input.substring(1, input.length) - } else if (input.startsWith("D")) { - output = output +"100#" - input = input.substring(1, input.length) - } else if (input.startsWith("E")) { - output = output +"0#" - input = input.substring(1, input.length) - } else if (input.startsWith("F")) { - output = output +"0010#" - input = input.substring(1, input.length) - } else if (input.startsWith("G")) { - output = output +"110#" - input = input.substring(1, input.length) - } else if (input.startsWith("H")) { - output = output +"0000#" - input = input.substring(1, input.length) - } else if (input.startsWith("I")) { - output = output +"00#" - input = input.substring(1, input.length) - } else if (input.startsWith("J")) { - output = output +"0111#" - input = input.substring(1, input.length) - } else if (input.startsWith("K")) { - output = output +"101#" - input = input.substring(1, input.length) - } else if (input.startsWith("L")) { - output = output +"0100#" - input = input.substring(1, input.length) - } else if (input.startsWith("M")) { - output = output +"11#" - input = input.substring(1, input.length) - } else if (input.startsWith("N")) { - output = output +"10#" - input = input.substring(1, input.length) - } else if (input.startsWith("O")) { - output = output +"111#" - input = input.substring(1, input.length) - } else if (input.startsWith("P")) { - output = output +"0110#" - input = input.substring(1, input.length) - } else if (input.startsWith("Q")) { - output = output +"1101#" - input = input.substring(1, input.length) - } else if (input.startsWith("R")) { - output = output +"010#" - input = input.substring(1, input.length) - } else if (input.startsWith("S")) { - output = output +"000#" - input = input.substring(1, input.length) - } else if (input.startsWith("T")) { - output = output +"1#" - input = input.substring(1, input.length) - } else if (input.startsWith("U")) { - output = output +"001#" - input = input.substring(1, input.length) - } else if (input.startsWith("V")) { - output = output +"0001#" - input = input.substring(1, input.length) - } else if (input.startsWith("W")) { - output = output +"011#" - input = input.substring(1, input.length) - } else if (input.startsWith("X")) { - output = output +"1001#" - input = input.substring(1, input.length) - } else if (input.startsWith("Y")) { - output = output +"1011#" - input = input.substring(1, input.length) - } else if (input.startsWith("Z")) { - output = output +"1100#" - input = input.substring(1, input.length) - } else if (input.startsWith("0")) { - output = output +"11111#" - input = input.substring(1, input.length) - } else if (input.startsWith("1")) { - output = output +"01111#" - input = input.substring(1, input.length) - } else if (input.startsWith("2")) { - output = output +"00111#" - input = input.substring(1, input.length) - } else if (input.startsWith("3")) { - output = output +"00011#" - input = input.substring(1, input.length) - } else if (input.startsWith("4")) { - output = output +"00001#" - input = input.substring(1, input.length) - } else if (input.startsWith("5")) { - output = output +"00000#" - input = input.substring(1, input.length) - } else if (input.startsWith("6")) { - output = output +"10000#" - input = input.substring(1, input.length) - } else if (input.startsWith("7")) { - output = output +"11000#" - input = input.substring(1, input.length) - } else if (input.startsWith("8")) { - output = output +"11100#" - input = input.substring(1, input.length) - } else if (input.startsWith("9")) { - output = output +"11110#" - input = input.substring(1, input.length) - } else if (input.startsWith("Ä")) { - output = output +"0101#" - input = input.substring(1, input.length) - } else if (input.startsWith("Ö")) { - output = output +"1110#" - input = input.substring(1, input.length) - } else if (input.startsWith("Ü")) { - output = output +"0011#" - input = input.substring(1, input.length) - } else if (input.startsWith("ß")) { - output = output +"00011000#" - input = input.substring(1, input.length) - } else if (input.startsWith(".")) { - output = output +"010101#" - input = input.substring(1, input.length) - } else if (input.startsWith(",")) { - output = output +"110011#" - input = input.substring(1, input.length) - } else if (input.startsWith(":")) { - output = output +"111000#" - input = input.substring(1, input.length) - } else if (input.startsWith(";")) { - output = output +"101010#" - input = input.substring(1, input.length) - } else if (input.startsWith("?")) { - output = output +"001100#" - input = input.substring(1, input.length) - } else if (input.startsWith("!")) { - output = output +"101011#" - input = input.substring(1, input.length) - } else if (input.startsWith("-")) { - output = output +"100001#" - input = input.substring(1, input.length) - } else if (input.startsWith("_")) { - output = output +"001101#" - input = input.substring(1, input.length) - } else if (input.startsWith("(")) { - output = output +"10110#" - input = input.substring(1, input.length) - } else if (input.startsWith(")")) { - output = output +"101101#" - input = input.substring(1, input.length) - } else if (input.startsWith("=")) { - output = output +"10001#" - input = input.substring(1, input.length) - } else if (input.startsWith("+")) { - output = output +"01010#" - input = input.substring(1, input.length) - } else if (input.startsWith("/")) { - output = output +"10010#" - input = input.substring(1, input.length) - } else if (input.startsWith("@")) { - output = output +"011010#" - input = input.substring(1, input.length) - } else if (input.startsWith("'")) { - output = output +"011110#" - input = input.substring(1, input.length) - } else if (input.startsWith("$")) { - output = output +"0001001#" - input = input.substring(1, input.length) - } else { - output = "Code not listed or wrong." - } - } - if (output.endsWith("#")) { - output = output.substring(0, output.length - 1) - } - } - return output - } -} diff --git a/js/web/web.js b/js/web/web.js deleted file mode 100644 index e96aa6b..0000000 --- a/js/web/web.js +++ /dev/null @@ -1,85 +0,0 @@ -var dur = 150 -var drawerStatus = true -var wm = true -function drawer(){ - if(window.innerWidth <= 1400){ - if(drawerStatus){ - $('.drawer').show('slide', {direction: 'left'}, dur) - $('.actionbar').before("
") - $('.overlay').animate({"opacity":"0.4"}, dur) - drawerStatus = false - } else { - $('.drawer').hide('slide', {direction: 'left'}, dur) - $('.overlay').animate({"opacity":"0"}, dur, function callback (){ - $('.overlay').remove() - }) - drawerStatus = true - } - } -} - -function encrypt(){ - var input = $('#textarea').val() - if(wm){ - $("#output").text(encryptWrittenMorseManager(input)) - } else { - //TODO port the normal morse decode engine - $("#output").html(encryptNormalMorseManager(input)) - } - $('#outputcard').fadeIn(dur) -} - -function decrypt(){ - var input = $('#textarea').val() - if(wm){ - $('#output').text(decryptWrittenMorseManager(input)) - } else { - //TODO port the normal morse decode engine - $("#output").text(decryptNormalMorseManager(input)) - } - $('#outputcard').fadeIn(dur) -} - -function writtenMorse(){ - wm = true - $("#normalMorse").css({"color":"#000000"}) - $("#writtenMorse").css({"color":"#03a9f4"}) - drawer() -} - -function normalMorse(){ - wm = false - $("#normalMorse").css({"color":"#03a9f4"}) - $("#writtenMorse").css({"color":"#000000"}) - drawer() -} - -function about(){ - $("body").fadeOut(dur, function callback(){ - window.location = "http://marcel-kapfer.de/writtenmorse" - }) -} - -function bug(){ - $("body").fadeOut(dur, function callback(){ - window.location = "https://github.com/mmk2410/morse-converter-web/issues" - }) -} - -window.onload = function() { - var t = document.getElementsByTagName('textarea')[0]; - var offset= !window.opera ? (t.offsetHeight - t.clientHeight) : (t.offsetHeight + parseInt(window.getComputedStyle(t, null).getPropertyValue('border-top-width'))) ; - - var resize = function(t) { - t.style.height = 'auto'; - t.style.height = (t.scrollHeight + offset ) + 'px'; - } - - t.addEventListener && t.addEventListener('input', function(event) { - resize(t); - }); - - t['attachEvent'] && t.attachEvent('onkeyup', function() { - resize(t); - }); -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e2d854b --- /dev/null +++ b/package.json @@ -0,0 +1,50 @@ +{ + "name": "morseconverter", + "version": "0.2.0", + "description": "A Morse converter for the web", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/mmk2410/morse-converter-web.git" + }, + "keywords": [ + "Morse", + "writtenMorse" + ], + "author": "mmk2410 ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mmk2410/morse-converter-web/issues" + }, + "homepage": "https://github.com/mmk2410/morse-converter-web#readme", + "devDependencies": { + "coffee-script": "^1.9.3", + "del": "^1.2.1", + "fs": "0.0.2", + "glob": "^5.0.14", + "gulp": "^3.9.0", + "gulp-autoprefixer": "^2.1.0", + "gulp-cache": "^0.2.10", + "gulp-coffee": "^2.3.1", + "gulp-if": "^1.2.5", + "gulp-imagemin": "^2.3.0", + "gulp-load-plugins": "^0.10.0", + "gulp-minify-html": "^1.0.2", + "gulp-rename": "^1.2.0", + "gulp-replace": "^0.5.3", + "gulp-size": "^1.0.0", + "gulp-uglify": "^1.2.0", + "gulp-uncss": "^1.0.1", + "gulp-useref": "^1.1.2", + "gulp-util": "^3.0.6", + "gulp-vulcanize": "^6.0.1", + "merge-stream": "^0.1.7", + "opn": "^1.0.0", + "require-dir": "^0.3.0", + "run-sequence": "^1.1.2", + "vulcanize": "^1.10.3" + } +} diff --git a/res/css/main.css b/res/css/main.css deleted file mode 100644 index f6c02cc..0000000 --- a/res/css/main.css +++ /dev/null @@ -1,160 +0,0 @@ -body { - font-family: "Roboto", sans-serif; - background: #f4f4f4; - margin: 0px; } - -.actionbar { - width: 100%; - height: 60px; - position: fixed; - background: #03a9f4; - top: 0px; - left: 0px; - padding-left: 320px; - color: #fff; - font-size: 25px; - line-height: 60px; - -webkit-box-shadow: 0px 4px 4px 0px #999; - -moz-box-shadow: 0px 4px 4px 0px #999; - -ms-box-shadow: 0px 4px 4px 0px #999; - box-shadow: 0px 4px 4px 0px #999; } - -.menuicon { - height: 30px; - position: fixed; - top: 0px; - left: 0px; - padding: 15px; - cursor: pointer; } - -.drawer { - width: 300px; - top: 0px; - left: 0px; - position: absolute; - height: 100%; - background: #fff; - border-right-width: 1px; - border-right-color: #cecece; - border-right-style: solid; - z-index: 50; - font-weight: 500; } - -.drawerimg { - width: 100%; } - -.draweritem, .draweritembottom { - height: 58px; - line-height: 58px; - font-size: 18px; - padding-left: 16px; - cursor: pointer; } - -.draweritembottom { - bottom: 0px; - position: absolute; - width: calc(100% - 16px); } - -.drawerdivider, .drawerdividerbottom, .carddivider { - border-top-color: #cecece; - border-top-width: 1px; - border-top-style: solid; } - -.drawerdividerbottom { - bottom: 60px; - position: absolute; - width: 100%; } - -.main { - width: calc(100% - 300px); - height: calc(100%-60px); - margin-left: 300px; - margin-top: 60px; } - -.card { - width: calc(50% - 36px); - background: #fff; - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - -ms-border-radius: 1px; - border-radius: 1px; - -webkit-box-shadow: 0px 0px 2px 2px #cecece; - -moz-box-shadow: 0px 0px 2px 2px #cecece; - -ms-box-shadow: 0px 0px 2px 2px #cecece; - box-shadow: 0px 0px 2px 2px #cecece; - display: inline-block; - margin: 16px; - float: left; - height: auto; } - -.input { - width: 100%; - resize: none; - border: 0px; - height: auto; - min-height: 100px; - font-family: "Roboto", sans-serif; - font-size: 16px; - padding: 20px; - clear: both; } - -.carddivider { - width: 100%; } - -.cardtext { - padding: 20px; } - -.cardbuttons { - float: right; - padding: 20px; } - -.cardbutton { - min-width: 64px; - margin-left: 8px; - padding: 5px; - color: #03a9f4; - cursor: pointer; } - -.overlay { - background: #000; - opacity: 0; - position: fixed; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - z-index: 30; } - -#output { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; - word-wrap: break-word; } - -#outputcard { - display: none; } - -#writtenmorse { - color: #03a9f4; } - -.version { - font-style: italic; - font-size: 20px; } - -@media screen and (max-width: 1400px) { - .drawer { - display: none; - border-right-width: 0px; } - - .actionbar { - padding-left: 60px; } - - .main { - width: 100%; - margin-left: 0px; } } -@media screen and (max-width: 750px) { - .card { - width: calc(100% - 36px); } } - -/*# sourceMappingURL=main.css.map */ diff --git a/res/css/main.sass b/res/css/main.sass deleted file mode 100644 index 9bdf9ec..0000000 --- a/res/css/main.sass +++ /dev/null @@ -1,178 +0,0 @@ -$font-stack: 'Roboto', sans-serif -$body-color: #f4f4f4 -$primary-color: #03a9f4 -$drawer-width: 300px -$actionbar-height: 60px -$actionbar-shadow: #999 -$divider-color: #cecece -$drawer-item-height: 58px -$drawer-item-font-size: 18px -$card-padding: 20px - -=border-radius($radius) - -webkit-border-radius: $radius - -moz-border-radius: $radius - -ms-border-radius: $radius - border-radius: $radius - -=box-shadow($horizontal, $vertical, $blur, $spread, $color) - -webkit-box-shadow: $horizontal $vertical $blur $spread $color - -moz-box-shadow: $horizontal $vertical $blur $spread $color - -ms-box-shadow: $horizontal $vertical $blur $spread $color - box-shadow: $horizontal $vertical $blur $spread $color - -=hyphens($value) - -moz-hyphens: $value - -ms-hyphens: $value - -webkit-hyphens: $value - hyphens: $value - -body - font-family: $font-stack - background: $body-color - margin: 0px - -.actionbar - width: 100% - height: $actionbar-height - position: fixed - background: $primary-color - top: 0px - left: 0px - padding-left: $drawer-width + 20 - color: #fff - font-size: 25px - line-height: $actionbar-height - +box-shadow(0px,4px,4px,0px,$actionbar-shadow) - -.menuicon - height: 30px - position: fixed - top: 0px - left: 0px - padding: 15px - cursor: pointer - -.drawer - width: $drawer-width - top: 0px - left: 0px - position: absolute - height: 100% - background: #fff - border-right-width: 1px - border-right-color: $divider-color - border-right-style: solid - z-index: 50 - font-weight: 500 - -.drawerimg - width: 100% - -.draweritem - height: $drawer-item-height - line-height: $drawer-item-height - font-size: $drawer-item-font-size - padding-left: 16px - cursor: pointer - -.draweritembottom - @extend .draweritem - bottom: 0px - position: absolute - width: calc(100% - 16px) - -.drawerdivider - border-top-color: $divider-color - border-top-width: 1px - border-top-style: solid - -.drawerdividerbottom - @extend .drawerdivider - bottom: 60px - position: absolute - width: 100% - -.main - width: calc(100% - 300px) - height: calc(100%-60px) - margin-left: $drawer-width - margin-top: $actionbar-height - -.card - width: calc(50% - 36px) - background: #fff - +border-radius(1px) - +box-shadow(0px,0px,2px,2px,$divider-color) - display: inline-block - margin: 16px - float: left - height: auto - -.input - width: 100% - resize: none - border: 0px - height: auto - min-height: 100px - font-family: $font-stack - font-size: 16px - padding: $card-padding - clear: both - -.carddivider - @extend .drawerdivider - width: 100% - -.cardtext - padding: $card-padding - -.cardbuttons - float: right - padding: $card-padding - -.cardbutton - min-width: 64px - margin-left: 8px - padding: 5px - color: $primary-color - cursor: pointer - -.overlay - background: #000 - opacity: 0 - position: fixed - top: 0px - left: 0px - width: 100% - height: 100% - z-index: 30 - -#output - +hyphens(auto) - word-wrap: break-word - - -#outputcard - display: none - -#writtenmorse - color: $primary-color - -.version - font-style: italic - font-size: 20px - -@media screen and (max-width: 1400px) - .drawer - display: none - border-right-width: 0px - .actionbar - padding-left: 60px - .main - width: 100% - margin-left: 0px - -@media screen and (max-width: 750px) - .card - width: calc(100% - 36px) diff --git a/res/img/drawergraphic.png b/res/img/drawergraphic.png deleted file mode 100644 index c91412c..0000000 Binary files a/res/img/drawergraphic.png and /dev/null differ diff --git a/res/img/favicon.png b/res/img/favicon.png deleted file mode 100644 index b21d915..0000000 Binary files a/res/img/favicon.png and /dev/null differ diff --git a/res/img/menu.svg b/res/img/menu.svg deleted file mode 100644 index e5cba3e..0000000 --- a/res/img/menu.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/res/js/jquery-2.1.3.min.js b/res/js/jquery-2.1.3.min.js deleted file mode 100644 index 25714ed..0000000 --- a/res/js/jquery-2.1.3.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c) -},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("