diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c00696 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.js +node_modules \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b82d587 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/*.js": true, + "**/*.map": true + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f33f18e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,38 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@types/chrome": { + "version": "0.0.146", + "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.146.tgz", + "integrity": "sha512-gghzXAVEGCWzo6ygME/sFAuU/PFNI8peDft3Eu8AA0GWHi2minRzB+uA2bGGJQYubdtt/qgPdXvZ45KThbGfSA==", + "requires": { + "@types/filesystem": "*", + "@types/har-format": "*" + } + }, + "@types/filesystem": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.32.tgz", + "integrity": "sha512-Yuf4jR5YYMR2DVgwuCiP11s0xuVRyPKmz8vo6HBY3CGdeMj8af93CFZX+T82+VD1+UqHOxTq31lO7MI7lepBtQ==", + "requires": { + "@types/filewriter": "*" + } + }, + "@types/filewriter": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/filewriter/-/filewriter-0.0.29.tgz", + "integrity": "sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==" + }, + "@types/firefox-webext-browser": { + "version": "82.0.1", + "resolved": "https://registry.npmjs.org/@types/firefox-webext-browser/-/firefox-webext-browser-82.0.1.tgz", + "integrity": "sha512-odcPKiJ34N8k53clIWen3hLvl09ja7SQ9NqtUbgmqeJ/a/ZRQiF665iXSFPcnl6cBn2XQgEg2lsUUApYNiyj+g==" + }, + "@types/har-format": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/har-format/-/har-format-1.2.7.tgz", + "integrity": "sha512-/TPzUG0tJn5x1TUcVLlDx2LqbE58hyOzDVAc9kf8SpOEmguHjU6bKUyfqb211AdqLOmU/SNyXvLKPNP5qTlfRw==" + } + } +} diff --git a/src/LICENSE.txt b/src/LICENSE.txt new file mode 100644 index 0000000..e72bfdd --- /dev/null +++ b/src/LICENSE.txt @@ -0,0 +1,674 @@ + 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. + + + Copyright (C) + + 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: + + Copyright (C) + 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 +. \ No newline at end of file diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json new file mode 100644 index 0000000..39118bb --- /dev/null +++ b/src/_locales/en/messages.json @@ -0,0 +1,265 @@ +{ + "extensionName": { + "message": "Browser Guard" + }, + + "extensionDescription": { + "message": "Protect browsers from accessing untrusted websites." + }, + + "extensionTagline": { + "message": "A browser extension for the paranoid." + }, + + "copy": { + "message": "Copy" + }, + + "backToSafety": { + "message": "Back to safety" + }, + + "trustAndContinue": { + "message": "Trust and continue" + }, + + "tempTrustAndContinue": { + "message": "Temporarily trust and continue" + }, + + "alsoTrustSubdomains": { + "message": "Also trust subdomains" + }, + + "details": { + "message": "Details" + }, + + "requestUrl": { + "message": "Request URL:" + }, + + "originUrl": { + "message": "Origin URL:" + }, + + "method": { + "message": "Method:" + }, + + "urlClassifications": { + "message": "URL Classifications:" + }, + + "untrustedDomain": { + "message": "Untrusted domain" + }, + + "untrustedDomainDesc": { + "message": "A request to this URL was blocked because the domain or subdomian is not trusted." + }, + + "unknownUrl": { + "message": "Unknown URL" + }, + + "trustedDomains": { + "message": "Trusted Domains" + }, + + "settings": { + "message": "Settings" + }, + + "about": { + "message": "About" + }, + + "domain": { + "message": "Domain" + }, + + "trustSubdomains": { + "message": "Trust Subdomains" + }, + + "expires": { + "message": "Expires" + }, + + "options": { + "message": "Options" + }, + + "enterDomain": { + "message": "Enter new domain to trust..." + }, + + "never": { + "message": "Never" + }, + + "minute": { + "message": "minute" + }, + + "minutes": { + "message": "minutes" + }, + + "hours": { + "message": "hours" + }, + + "addTrust": { + "message": "Add Trust" + }, + + "trustSettings": { + "message": "Trust Settings" + }, + + "trustSubdomainsDefault": { + "message": "Trust subdomains by default" + }, + + "checkTrustSubdomains": { + "message": "Check the \"Trust Subdomains\" checkbox by default." + }, + + "ignoreWwwSubdomain": { + "message": "Ignore \"www\" subdomain" + }, + + "removeWwwDesc": { + "message": "Remove \"www.\" from domains before trusting them and ignore \"www\" subdomains such that trusting \"example.com\" also trusts \"www.example.com\"." + }, + + "tempTrustDuration": { + "message": "Temporary trust duration" + }, + + "tempTrustDurationDesc": { + "message": "The duration to temporarily trust domains if the \"Temporarily trust and continue\" button is clicked." + }, + + "tempTrustDefault": { + "message": "Temporarily trust by default" + }, + + "tempTrustDefaultDesc": { + "message": "All settings will use the \"Temporary trust default duration\" setting by default (e.g. \"Never\" won't be selected by default)." + }, + + "importExportSync": { + "message": "Import, Export, and Sync" + }, + + "importTrustedDomains": { + "message": "Import trusted domains" + }, + + "importTrustedDomainsDesc": { + "message": "Import trusted domains from a file." + }, + + "exportTrustedDomains": { + "message": "Export trusted domains" + }, + + "exportTrustedDomainsDesc": { + "message": "Export trusted domains to a file." + }, + + "resetSettingsTitle": { + "message": "Reset Settings" + }, + + "resetTrustedDomains": { + "message": "Reset trusted domains" + }, + + "resetTrustedDomainsDesc": { + "message": "Remove all trusted domains and add default trusted domains (if any)." + }, + + "resetSettings": { + "message": "Reset settings" + }, + + "resetSettingsDesc": { + "message": "Reset all settings to default (excluding trusted domains)." + }, + + "version": { + "message": "Version" + }, + + "viewSource": { + "message": "View the source on" + }, + + "createdBy": { + "message": "Created by" + }, + + "for": { + "message": "for" + }, + + "licenseBlock1": { + "message": "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." + }, + + "licenseBlock2": { + "message": "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." + }, + + "licenseBlock3": { + "message": "You should have received a copy of the GNU General Public License along with this program. If not, see" + }, + + "removeTrust": { + "message": "Remove Trust" + }, + + "noTrustedDomainsFound": { + "message": "No trusted domains found." + }, + + "domainNotTrusted": { + "message": "This domain is not trusted." + }, + + "domainTempTrusted": { + "message": "This domain is temporarily trusted." + }, + + "domainIsTrusted": { + "message": "This domain is trusted." + }, + + "domainIsBrowser": { + "message": "This is a secure browser page." + }, + + "domainTrustedBuRule": { + "message": "Domain is trusted by this rule:" + }, + + "domainIsExtension": { + "message": "This is an extension page." + }, + + "trustExpiresIn": { + "message": "Trust expires in" + }, + + "trustTemporarily": { + "message": "Trust temporarily" + }, + + "trustPermanently": { + "message": "Trust permanently" + } +} diff --git a/src/art/browser-guard.afdesign b/src/art/browser-guard.afdesign new file mode 100644 index 0000000..6889463 Binary files /dev/null and b/src/art/browser-guard.afdesign differ diff --git a/src/art/browser-guard.svg b/src/art/browser-guard.svg new file mode 100644 index 0000000..be71f53 --- /dev/null +++ b/src/art/browser-guard.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/art/cog.svg b/src/art/cog.svg new file mode 100644 index 0000000..7ce4a16 --- /dev/null +++ b/src/art/cog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/css/background.css b/src/css/background.css new file mode 100644 index 0000000..e69de29 diff --git a/src/css/blocked.css b/src/css/blocked.css new file mode 100644 index 0000000..c001c36 --- /dev/null +++ b/src/css/blocked.css @@ -0,0 +1,128 @@ +#main-image-wrap { + padding: 20px 0; +} + +#content { + padding: 15px 100px; +} + +@media (max-width: 700px) { + #content { + padding: 15px; + } +} + +#main-image { + width: 200px; + height: 200px; + margin: 0 auto; + display: block; +} + +#blocked-reason { + width: 100%; + text-align: center; +} + +#blocked-explanation { + margin-top: 30px; + width: 100%; + margin-bottom: 5px; +} + +#blocked-domain-name { + font-weight: bold; + word-wrap: anywhere; +} + +#blocked-url { + width: calc(100% - 60px); + cursor: default; +} + +#copy-url { + width: 42px; + height: 27px; + float: right; +} + +.action-button { + display: inline-block; + font-weight: bold; +} + +button#temp-trust-domain { + float: right; + margin-right: 10px; +} + +button#trust-domain { + float: right; +} + +#trust-action-group { + float: right; +} + +#trust-subdomains-wrap { + padding-top: 47px; +} + +#trust-subdomains-wrap * { + display: inline-block; +} + +@media (max-width: 500px) { + .action-button { + width: 210px; + text-align: center; + float: none !important; + display: block; + margin: 18px auto 0 auto !important; + } + + #trust-action-group { + width: 100%; + float: none !important; + } + + #trust-subdomains-wrap { + padding-top: 18px; + text-align: center; + } +} + +#details-wrap { + display: block; + clear: both; +} + +#details-toggle { + text-decoration: underline; + cursor: pointer; + color: rgb(115, 115, 252); + user-select: none; + -moz-user-select: none; +} + +.details-row { + padding: 5px; + border-radius: 5px; +} + +.details-row:hover { + background-color: #efefef; +} + +.details-title { + display: table-cell; + width: 120px; + vertical-align: middle; +} + +.details-value { + display: table-cell; + font-family: 'Courier New', Courier, monospace; + padding-left: 5px; + word-wrap: anywhere; +} diff --git a/src/css/bootstrap.css b/src/css/bootstrap.css new file mode 100644 index 0000000..102fdfa --- /dev/null +++ b/src/css/bootstrap.css @@ -0,0 +1,3990 @@ +/*! + * Bootstrap v2.0.1 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; +} +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +a:hover, +a:active { + outline: 0; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + height: auto; + border: 0; + -ms-interpolation-mode: bicubic; + vertical-align: middle; +} +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} +button, +input { + *overflow: visible; + line-height: normal; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} +input[type="search"] { + -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} +textarea { + overflow: auto; + vertical-align: top; +} +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.hide-text { + overflow: hidden; + text-indent: 100%; + white-space: nowrap; +} +.input-block-level { + display: block; + width: 100%; + min-height: 28px; + /* Make inputs at least the height of their button counterpart */ + + /* Makes inputs behave like true block-level elements */ + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 18px; + color: #333333; + background-color: #ffffff; +} +a { + color: #0088cc; + text-decoration: none; +} +a:hover { + color: #005580; + text-decoration: underline; +} +.row { + margin-left: -20px; + *zoom: 1; +} +.row:before, +.row:after { + display: table; + content: ""; +} +.row:after { + clear: both; +} +[class*="span"] { + float: left; + margin-left: 20px; +} +.container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.span12 { + width: 940px; +} +.span11 { + width: 860px; +} +.span10 { + width: 780px; +} +.span9 { + width: 700px; +} +.span8 { + width: 620px; +} +.span7 { + width: 540px; +} +.span6 { + width: 460px; +} +.span5 { + width: 380px; +} +.span4 { + width: 300px; +} +.span3 { + width: 220px; +} +.span2 { + width: 140px; +} +.span1 { + width: 60px; +} +.offset12 { + margin-left: 980px; +} +.offset11 { + margin-left: 900px; +} +.offset10 { + margin-left: 820px; +} +.offset9 { + margin-left: 740px; +} +.offset8 { + margin-left: 660px; +} +.offset7 { + margin-left: 580px; +} +.offset6 { + margin-left: 500px; +} +.offset5 { + margin-left: 420px; +} +.offset4 { + margin-left: 340px; +} +.offset3 { + margin-left: 260px; +} +.offset2 { + margin-left: 180px; +} +.offset1 { + margin-left: 100px; +} +.row-fluid { + width: 100%; + *zoom: 1; +} +.row-fluid:before, +.row-fluid:after { + display: table; + content: ""; +} +.row-fluid:after { + clear: both; +} +.row-fluid > [class*="span"] { + float: left; + margin-left: 2.127659574%; +} +.row-fluid > [class*="span"]:first-child { + margin-left: 0; +} +.row-fluid > .span12 { + width: 99.99999998999999%; +} +.row-fluid > .span11 { + width: 91.489361693%; +} +.row-fluid > .span10 { + width: 82.97872339599999%; +} +.row-fluid > .span9 { + width: 74.468085099%; +} +.row-fluid > .span8 { + width: 65.95744680199999%; +} +.row-fluid > .span7 { + width: 57.446808505%; +} +.row-fluid > .span6 { + width: 48.93617020799999%; +} +.row-fluid > .span5 { + width: 40.425531911%; +} +.row-fluid > .span4 { + width: 31.914893614%; +} +.row-fluid > .span3 { + width: 23.404255317%; +} +.row-fluid > .span2 { + width: 14.89361702%; +} +.row-fluid > .span1 { + width: 6.382978723%; +} +.container { + margin-left: auto; + margin-right: auto; + *zoom: 1; +} +.container:before, +.container:after { + display: table; + content: ""; +} +.container:after { + clear: both; +} +.container-fluid { + padding-left: 20px; + padding-right: 20px; + *zoom: 1; +} +.container-fluid:before, +.container-fluid:after { + display: table; + content: ""; +} +.container-fluid:after { + clear: both; +} +p { + margin: 0 0 9px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 18px; +} +p small { + font-size: 11px; + color: #999999; +} +.lead { + margin-bottom: 18px; + font-size: 20px; + font-weight: 200; + line-height: 27px; +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + font-family: inherit; + font-weight: bold; + color: inherit; + text-rendering: optimizelegibility; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + color: #999999; +} +h1 { + font-size: 30px; + line-height: 36px; +} +h1 small { + font-size: 18px; +} +h2 { + font-size: 24px; + line-height: 36px; +} +h2 small { + font-size: 18px; +} +h3 { + line-height: 27px; + font-size: 18px; +} +h3 small { + font-size: 14px; +} +h4, +h5, +h6 { + line-height: 18px; +} +h4 { + font-size: 14px; +} +h4 small { + font-size: 12px; +} +h5 { + font-size: 12px; +} +h6 { + font-size: 11px; + color: #999999; + text-transform: uppercase; +} +.page-header { + padding-bottom: 17px; + margin: 18px 0; + border-bottom: 1px solid #eeeeee; +} +.page-header h1 { + line-height: 1; +} +ul, +ol { + padding: 0; + margin: 0 0 9px 25px; +} +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} +ul { + list-style: disc; +} +ol { + list-style: decimal; +} +li { + line-height: 18px; +} +ul.unstyled, +ol.unstyled { + margin-left: 0; + list-style: none; +} +dl { + margin-bottom: 18px; +} +dt, +dd { + line-height: 18px; +} +dt { + font-weight: bold; + line-height: 17px; +} +dd { + margin-left: 9px; +} +.dl-horizontal dt { + float: left; + clear: left; + width: 120px; + text-align: right; +} +.dl-horizontal dd { + margin-left: 130px; +} +hr { + margin: 18px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; +} +strong { + font-weight: bold; +} +em { + font-style: italic; +} +.muted { + color: #999999; +} +abbr[title] { + border-bottom: 1px dotted #ddd; + cursor: help; +} +abbr.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 0 0 0 15px; + margin: 0 0 18px; + border-left: 5px solid #eeeeee; +} +blockquote p { + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 22.5px; +} +blockquote small { + display: block; + line-height: 18px; + color: #999999; +} +blockquote small:before { + content: '\2014 \00A0'; +} +blockquote.pull-right { + float: right; + padding-left: 0; + padding-right: 15px; + border-left: 0; + border-right: 5px solid #eeeeee; +} +blockquote.pull-right p, +blockquote.pull-right small { + text-align: right; +} +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} +address { + display: block; + margin-bottom: 18px; + line-height: 18px; + font-style: normal; +} +small { + font-size: 100%; +} +cite { + font-style: normal; +} +code, +pre { + padding: 0 3px 2px; + font-family: Menlo, Monaco, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +code { + padding: 2px 4px; + color: #d14; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +pre { + display: block; + padding: 8.5px; + margin: 0 0 9px; + font-size: 12.025px; + line-height: 18px; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; +} +pre.prettyprint { + margin-bottom: 18px; +} +pre code { + padding: 0; + color: inherit; + background-color: transparent; + border: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +form { + margin: 0 0 18px; +} +fieldset { + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 27px; + font-size: 19.5px; + line-height: 36px; + color: #333333; + border: 0; + border-bottom: 1px solid #eee; +} +legend small { + font-size: 13.5px; + color: #999999; +} +label, +input, +button, +select, +textarea { + font-size: 13px; + font-weight: normal; + line-height: 18px; +} +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +label { + display: block; + margin-bottom: 5px; + color: #333333; +} +input, +textarea, +select, +.uneditable-input { + display: inline-block; + width: 210px; + height: 18px; + padding: 4px; + margin-bottom: 9px; + font-size: 13px; + line-height: 18px; + color: #555555; + border: 1px solid #cccccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.uneditable-textarea { + width: auto; + height: auto; +} +label input, +label textarea, +label select { + display: block; +} +input[type="image"], +input[type="checkbox"], +input[type="radio"] { + width: auto; + height: auto; + padding: 0; + margin: 3px 0; + *margin-top: 0; + /* IE7 */ + + line-height: normal; + cursor: pointer; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + border: 0 \9; + /* IE9 and down */ + +} +input[type="image"] { + border: 0; +} +input[type="file"] { + width: auto; + padding: initial; + line-height: initial; + border: initial; + background-color: #ffffff; + background-color: initial; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +input[type="button"], +input[type="reset"], +input[type="submit"] { + width: auto; + height: auto; +} +select, +input[type="file"] { + height: 28px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 28px; +} +input[type="file"] { + line-height: 18px \9; +} +select { + width: 220px; + background-color: #ffffff; +} +select[multiple], +select[size] { + height: auto; +} +input[type="image"] { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +textarea { + height: auto; +} +input[type="hidden"] { + display: none; +} +.radio, +.checkbox { + padding-left: 18px; +} +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -18px; +} +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} +input, +textarea { + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} +input:focus, +textarea:focus { + border-color: rgba(82, 168, 236, 0.8); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus, +select:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.input-mini { + width: 60px; +} +.input-small { + width: 90px; +} +.input-medium { + width: 150px; +} +.input-large { + width: 210px; +} +.input-xlarge { + width: 270px; +} +.input-xxlarge { + width: 530px; +} +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input { + float: none; + margin-left: 0; +} +input, +textarea, +.uneditable-input { + margin-left: 0; +} +input.span12, textarea.span12, .uneditable-input.span12 { + width: 930px; +} +input.span11, textarea.span11, .uneditable-input.span11 { + width: 850px; +} +input.span10, textarea.span10, .uneditable-input.span10 { + width: 770px; +} +input.span9, textarea.span9, .uneditable-input.span9 { + width: 690px; +} +input.span8, textarea.span8, .uneditable-input.span8 { + width: 610px; +} +input.span7, textarea.span7, .uneditable-input.span7 { + width: 530px; +} +input.span6, textarea.span6, .uneditable-input.span6 { + width: 450px; +} +input.span5, textarea.span5, .uneditable-input.span5 { + width: 370px; +} +input.span4, textarea.span4, .uneditable-input.span4 { + width: 290px; +} +input.span3, textarea.span3, .uneditable-input.span3 { + width: 210px; +} +input.span2, textarea.span2, .uneditable-input.span2 { + width: 130px; +} +input.span1, textarea.span1, .uneditable-input.span1 { + width: 50px; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + background-color: #eeeeee; + border-color: #ddd; + cursor: not-allowed; +} +.control-group.warning > label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; + border-color: #c09853; +} +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: 0 0 6px #dbc59e; + -moz-box-shadow: 0 0 6px #dbc59e; + box-shadow: 0 0 6px #dbc59e; +} +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} +.control-group.error > label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; + border-color: #b94a48; +} +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: 0 0 6px #d59392; + -moz-box-shadow: 0 0 6px #d59392; + box-shadow: 0 0 6px #d59392; +} +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} +.control-group.success > label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; + border-color: #468847; +} +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: 0 0 6px #7aba7b; + -moz-box-shadow: 0 0 6px #7aba7b; + box-shadow: 0 0 6px #7aba7b; +} +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} +input:focus:required:invalid, +textarea:focus:required:invalid, +select:focus:required:invalid { + color: #b94a48; + border-color: #ee5f5b; +} +input:focus:required:invalid:focus, +textarea:focus:required:invalid:focus, +select:focus:required:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +.form-actions { + padding: 17px 20px 18px; + margin-top: 18px; + margin-bottom: 18px; + background-color: #eeeeee; + border-top: 1px solid #ddd; + *zoom: 1; +} +.form-actions:before, +.form-actions:after { + display: table; + content: ""; +} +.form-actions:after { + clear: both; +} +.uneditable-input { + display: block; + background-color: #ffffff; + border-color: #eee; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + cursor: not-allowed; +} +:-moz-placeholder { + color: #999999; +} +::-webkit-input-placeholder { + color: #999999; +} +.help-block, +.help-inline { + color: #555555; +} +.help-block { + display: block; + margin-bottom: 9px; +} +.help-inline { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + vertical-align: middle; + padding-left: 5px; +} +.input-prepend, +.input-append { + margin-bottom: 5px; +} +.input-prepend input, +.input-append input, +.input-prepend select, +.input-append select, +.input-prepend .uneditable-input, +.input-append .uneditable-input { + *margin-left: 0; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend input:focus, +.input-append input:focus, +.input-prepend select:focus, +.input-append select:focus, +.input-prepend .uneditable-input:focus, +.input-append .uneditable-input:focus { + position: relative; + z-index: 2; +} +.input-prepend .uneditable-input, +.input-append .uneditable-input { + border-left-color: #ccc; +} +.input-prepend .add-on, +.input-append .add-on { + display: inline-block; + width: auto; + min-width: 16px; + height: 18px; + padding: 4px 5px; + font-weight: normal; + line-height: 18px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + vertical-align: middle; + background-color: #eeeeee; + border: 1px solid #ccc; +} +.input-prepend .add-on, +.input-append .add-on, +.input-prepend .btn, +.input-append .btn { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend .active, +.input-append .active { + background-color: #a9dba9; + border-color: #46a546; +} +.input-prepend .add-on, +.input-prepend .btn { + margin-right: -1px; +} +.input-append input, +.input-append select .uneditable-input { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .uneditable-input { + border-left-color: #eee; + border-right-color: #ccc; +} +.input-append .add-on, +.input-append .btn { + margin-left: -1px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend.input-append input, +.input-prepend.input-append select, +.input-prepend.input-append .uneditable-input { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.input-prepend.input-append .add-on:first-child, +.input-prepend.input-append .btn:first-child { + margin-right: -1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend.input-append .add-on:last-child, +.input-prepend.input-append .btn:last-child { + margin-left: -1px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.search-query { + padding-left: 14px; + padding-right: 14px; + margin-bottom: 0; + -webkit-border-radius: 14px; + -moz-border-radius: 14px; + border-radius: 14px; +} +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input, +.form-search .input-prepend, +.form-inline .input-prepend, +.form-horizontal .input-prepend, +.form-search .input-append, +.form-inline .input-append, +.form-horizontal .input-append { + display: inline-block; + margin-bottom: 0; +} +.form-search .hide, +.form-inline .hide, +.form-horizontal .hide { + display: none; +} +.form-search label, +.form-inline label { + display: inline-block; +} +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + margin-bottom: 0; +} +.form-search .radio, +.form-search .checkbox, +.form-inline .radio, +.form-inline .checkbox { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"], +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-left: 0; + margin-right: 3px; +} +.control-group { + margin-bottom: 9px; +} +legend + .control-group { + margin-top: 18px; + -webkit-margin-top-collapse: separate; +} +.form-horizontal .control-group { + margin-bottom: 18px; + *zoom: 1; +} +.form-horizontal .control-group:before, +.form-horizontal .control-group:after { + display: table; + content: ""; +} +.form-horizontal .control-group:after { + clear: both; +} +.form-horizontal .control-label { + float: left; + width: 140px; + padding-top: 5px; + text-align: right; +} +.form-horizontal .controls { + margin-left: 160px; + /* Super jank IE7 fix to ensure the inputs in .input-append and input-prepend don't inherit the margin of the parent, in this case .controls */ + + *display: inline-block; + *margin-left: 0; + *padding-left: 20px; +} +.form-horizontal .help-block { + margin-top: 9px; + margin-bottom: 0; +} +.form-horizontal .form-actions { + padding-left: 160px; +} +table { + max-width: 100%; + border-collapse: collapse; + border-spacing: 0; + background-color: transparent; +} +.table { + width: 100%; + margin-bottom: 18px; +} +.table th, +.table td { + padding: 8px; + line-height: 18px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table th { + font-weight: bold; +} +.table thead th { + vertical-align: bottom; +} +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} +.table tbody + tbody { + border-top: 2px solid #dddddd; +} +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} +.table-bordered { + border: 1px solid #dddddd; + border-left: 0; + border-collapse: separate; + *border-collapse: collapsed; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} +.table-bordered thead:first-child tr:first-child th:first-child, +.table-bordered tbody:first-child tr:first-child td:first-child { + -webkit-border-radius: 4px 0 0 0; + -moz-border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; +} +.table-bordered thead:first-child tr:first-child th:last-child, +.table-bordered tbody:first-child tr:first-child td:last-child { + -webkit-border-radius: 0 4px 0 0; + -moz-border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; +} +.table-bordered thead:last-child tr:last-child th:first-child, +.table-bordered tbody:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; +} +.table-bordered thead:last-child tr:last-child th:last-child, +.table-bordered tbody:last-child tr:last-child td:last-child { + -webkit-border-radius: 0 0 4px 0; + -moz-border-radius: 0 0 4px 0; + border-radius: 0 0 4px 0; +} +.table-striped tbody tr:nth-child(odd) td, +.table-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.table tbody tr:hover td, +.table tbody tr:hover th { + background-color: #f5f5f5; +} +table .span1 { + float: none; + width: 44px; + margin-left: 0; +} +table .span2 { + float: none; + width: 124px; + margin-left: 0; +} +table .span3 { + float: none; + width: 204px; + margin-left: 0; +} +table .span4 { + float: none; + width: 284px; + margin-left: 0; +} +table .span5 { + float: none; + width: 364px; + margin-left: 0; +} +table .span6 { + float: none; + width: 444px; + margin-left: 0; +} +table .span7 { + float: none; + width: 524px; + margin-left: 0; +} +table .span8 { + float: none; + width: 604px; + margin-left: 0; +} +table .span9 { + float: none; + width: 684px; + margin-left: 0; +} +table .span10 { + float: none; + width: 764px; + margin-left: 0; +} +table .span11 { + float: none; + width: 844px; + margin-left: 0; +} +table .span12 { + float: none; + width: 924px; + margin-left: 0; +} +table .span13 { + float: none; + width: 1004px; + margin-left: 0; +} +table .span14 { + float: none; + width: 1084px; + margin-left: 0; +} +table .span15 { + float: none; + width: 1164px; + margin-left: 0; +} +table .span16 { + float: none; + width: 1244px; + margin-left: 0; +} +table .span17 { + float: none; + width: 1324px; + margin-left: 0; +} +table .span18 { + float: none; + width: 1404px; + margin-left: 0; +} +table .span19 { + float: none; + width: 1484px; + margin-left: 0; +} +table .span20 { + float: none; + width: 1564px; + margin-left: 0; +} +table .span21 { + float: none; + width: 1644px; + margin-left: 0; +} +table .span22 { + float: none; + width: 1724px; + margin-left: 0; +} +table .span23 { + float: none; + width: 1804px; + margin-left: 0; +} +table .span24 { + float: none; + width: 1884px; + margin-left: 0; +} +[class^="icon-"], +[class*=" icon-"] { + display: inline-block; + width: 14px; + height: 14px; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; + *margin-right: .3em; +} +[class^="icon-"]:last-child, +[class*=" icon-"]:last-child { + *margin-left: 0; +} +.icon-white { + background-image: url("../img/glyphicons-halflings-white.png"); +} +.icon-glass { + background-position: 0 0; +} +.icon-music { + background-position: -24px 0; +} +.icon-search { + background-position: -48px 0; +} +.icon-envelope { + background-position: -72px 0; +} +.icon-heart { + background-position: -96px 0; +} +.icon-star { + background-position: -120px 0; +} +.icon-star-empty { + background-position: -144px 0; +} +.icon-user { + background-position: -168px 0; +} +.icon-film { + background-position: -192px 0; +} +.icon-th-large { + background-position: -216px 0; +} +.icon-th { + background-position: -240px 0; +} +.icon-th-list { + background-position: -264px 0; +} +.icon-ok { + background-position: -288px 0; +} +.icon-remove { + background-position: -312px 0; +} +.icon-zoom-in { + background-position: -336px 0; +} +.icon-zoom-out { + background-position: -360px 0; +} +.icon-off { + background-position: -384px 0; +} +.icon-signal { + background-position: -408px 0; +} +.icon-cog { + background-position: -432px 0; +} +.icon-trash { + background-position: -456px 0; +} +.icon-home { + background-position: 0 -24px; +} +.icon-file { + background-position: -24px -24px; +} +.icon-time { + background-position: -48px -24px; +} +.icon-road { + background-position: -72px -24px; +} +.icon-download-alt { + background-position: -96px -24px; +} +.icon-download { + background-position: -120px -24px; +} +.icon-upload { + background-position: -144px -24px; +} +.icon-inbox { + background-position: -168px -24px; +} +.icon-play-circle { + background-position: -192px -24px; +} +.icon-repeat { + background-position: -216px -24px; +} +.icon-refresh { + background-position: -240px -24px; +} +.icon-list-alt { + background-position: -264px -24px; +} +.icon-lock { + background-position: -287px -24px; +} +.icon-flag { + background-position: -312px -24px; +} +.icon-headphones { + background-position: -336px -24px; +} +.icon-volume-off { + background-position: -360px -24px; +} +.icon-volume-down { + background-position: -384px -24px; +} +.icon-volume-up { + background-position: -408px -24px; +} +.icon-qrcode { + background-position: -432px -24px; +} +.icon-barcode { + background-position: -456px -24px; +} +.icon-tag { + background-position: 0 -48px; +} +.icon-tags { + background-position: -25px -48px; +} +.icon-book { + background-position: -48px -48px; +} +.icon-bookmark { + background-position: -72px -48px; +} +.icon-print { + background-position: -96px -48px; +} +.icon-camera { + background-position: -120px -48px; +} +.icon-font { + background-position: -144px -48px; +} +.icon-bold { + background-position: -167px -48px; +} +.icon-italic { + background-position: -192px -48px; +} +.icon-text-height { + background-position: -216px -48px; +} +.icon-text-width { + background-position: -240px -48px; +} +.icon-align-left { + background-position: -264px -48px; +} +.icon-align-center { + background-position: -288px -48px; +} +.icon-align-right { + background-position: -312px -48px; +} +.icon-align-justify { + background-position: -336px -48px; +} +.icon-list { + background-position: -360px -48px; +} +.icon-indent-left { + background-position: -384px -48px; +} +.icon-indent-right { + background-position: -408px -48px; +} +.icon-facetime-video { + background-position: -432px -48px; +} +.icon-picture { + background-position: -456px -48px; +} +.icon-pencil { + background-position: 0 -72px; +} +.icon-map-marker { + background-position: -24px -72px; +} +.icon-adjust { + background-position: -48px -72px; +} +.icon-tint { + background-position: -72px -72px; +} +.icon-edit { + background-position: -96px -72px; +} +.icon-share { + background-position: -120px -72px; +} +.icon-check { + background-position: -144px -72px; +} +.icon-move { + background-position: -168px -72px; +} +.icon-step-backward { + background-position: -192px -72px; +} +.icon-fast-backward { + background-position: -216px -72px; +} +.icon-backward { + background-position: -240px -72px; +} +.icon-play { + background-position: -264px -72px; +} +.icon-pause { + background-position: -288px -72px; +} +.icon-stop { + background-position: -312px -72px; +} +.icon-forward { + background-position: -336px -72px; +} +.icon-fast-forward { + background-position: -360px -72px; +} +.icon-step-forward { + background-position: -384px -72px; +} +.icon-eject { + background-position: -408px -72px; +} +.icon-chevron-left { + background-position: -432px -72px; +} +.icon-chevron-right { + background-position: -456px -72px; +} +.icon-plus-sign { + background-position: 0 -96px; +} +.icon-minus-sign { + background-position: -24px -96px; +} +.icon-remove-sign { + background-position: -48px -96px; +} +.icon-ok-sign { + background-position: -72px -96px; +} +.icon-question-sign { + background-position: -96px -96px; +} +.icon-info-sign { + background-position: -120px -96px; +} +.icon-screenshot { + background-position: -144px -96px; +} +.icon-remove-circle { + background-position: -168px -96px; +} +.icon-ok-circle { + background-position: -192px -96px; +} +.icon-ban-circle { + background-position: -216px -96px; +} +.icon-arrow-left { + background-position: -240px -96px; +} +.icon-arrow-right { + background-position: -264px -96px; +} +.icon-arrow-up { + background-position: -289px -96px; +} +.icon-arrow-down { + background-position: -312px -96px; +} +.icon-share-alt { + background-position: -336px -96px; +} +.icon-resize-full { + background-position: -360px -96px; +} +.icon-resize-small { + background-position: -384px -96px; +} +.icon-plus { + background-position: -408px -96px; +} +.icon-minus { + background-position: -433px -96px; +} +.icon-asterisk { + background-position: -456px -96px; +} +.icon-exclamation-sign { + background-position: 0 -120px; +} +.icon-gift { + background-position: -24px -120px; +} +.icon-leaf { + background-position: -48px -120px; +} +.icon-fire { + background-position: -72px -120px; +} +.icon-eye-open { + background-position: -96px -120px; +} +.icon-eye-close { + background-position: -120px -120px; +} +.icon-warning-sign { + background-position: -144px -120px; +} +.icon-plane { + background-position: -168px -120px; +} +.icon-calendar { + background-position: -192px -120px; +} +.icon-random { + background-position: -216px -120px; +} +.icon-comment { + background-position: -240px -120px; +} +.icon-magnet { + background-position: -264px -120px; +} +.icon-chevron-up { + background-position: -288px -120px; +} +.icon-chevron-down { + background-position: -313px -119px; +} +.icon-retweet { + background-position: -336px -120px; +} +.icon-shopping-cart { + background-position: -360px -120px; +} +.icon-folder-close { + background-position: -384px -120px; +} +.icon-folder-open { + background-position: -408px -120px; +} +.icon-resize-vertical { + background-position: -432px -119px; +} +.icon-resize-horizontal { + background-position: -456px -118px; +} +.dropdown { + position: relative; +} +.dropdown-toggle { + *margin-bottom: -3px; +} +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000000; + opacity: 0.3; + filter: alpha(opacity=30); + content: ""; +} +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} +.dropdown:hover .caret, +.open.dropdown .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + float: left; + display: none; + min-width: 160px; + padding: 4px 0; + margin: 0; + list-style: none; + background-color: #ffffff; + border-color: #ccc; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 1px; + -webkit-border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + border-radius: 0 0 5px 5px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + *border-right-width: 2px; + *border-bottom-width: 2px; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 8px 1px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; + *width: 100%; + *margin: -5px 0 5px; +} +.dropdown-menu a { + display: block; + padding: 3px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #333333; + white-space: nowrap; +} +.dropdown-menu li > a:hover, +.dropdown-menu .active > a, +.dropdown-menu .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #0088cc; +} +.dropdown.open { + *z-index: 1000; +} +.dropdown.open .dropdown-toggle { + color: #ffffff; + background: #ccc; + background: rgba(0, 0, 0, 0.3); +} +.dropdown.open .dropdown-menu { + display: block; +} +.pull-right .dropdown-menu { + left: auto; + right: 0; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid #000000; + content: "\2191"; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +.typeahead { + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #eee; + border: 1px solid rgba(0, 0, 0, 0.05); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-large { + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.well-small { + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.fade { + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -ms-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; + opacity: 0; +} +.fade.in { + opacity: 1; +} +.collapse { + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -ms-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; + position: relative; + overflow: hidden; + height: 0; +} +.collapse.in { + height: auto; +} +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 18px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover { + color: #000000; + text-decoration: none; + opacity: 0.4; + filter: alpha(opacity=40); + cursor: pointer; +} +.btn { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + padding: 4px 10px 4px; + margin-bottom: 0; + font-size: 13px; + line-height: 18px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(top, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); + border: 1px solid #cccccc; + border-bottom-color: #b3b3b3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + cursor: pointer; + *margin-left: .3em; +} +.btn:hover, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + background-color: #e6e6e6; +} +.btn:active, +.btn.active { + background-color: #cccccc \9; +} +.btn:first-child { + *margin-left: 0; +} +.btn:hover { + color: #333333; + text-decoration: none; + background-color: #e6e6e6; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -ms-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn.active, +.btn:active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #e6e6e6; + background-color: #d9d9d9 \9; + outline: 0; +} +.btn.disabled, +.btn[disabled] { + cursor: default; + background-image: none; + background-color: #e6e6e6; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn-large { + padding: 9px 14px; + font-size: 15px; + line-height: normal; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.btn-large [class^="icon-"] { + margin-top: 1px; +} +.btn-small { + padding: 5px 9px; + font-size: 11px; + line-height: 16px; +} +.btn-small [class^="icon-"] { + margin-top: -1px; +} +.btn-mini { + padding: 2px 6px; + font-size: 11px; + line-height: 14px; +} +.btn-primary, +.btn-primary:hover, +.btn-warning, +.btn-warning:hover, +.btn-danger, +.btn-danger:hover, +.btn-success, +.btn-success:hover, +.btn-info, +.btn-info:hover, +.btn-inverse, +.btn-inverse:hover { + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + color: #ffffff; +} +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + color: rgba(255, 255, 255, 0.75); +} +.btn-primary { + background-color: #0074cc; + background-image: -moz-linear-gradient(top, #0088cc, #0055cc); + background-image: -ms-linear-gradient(top, #0088cc, #0055cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0055cc); + background-image: -o-linear-gradient(top, #0088cc, #0055cc); + background-image: linear-gradient(top, #0088cc, #0055cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0); + border-color: #0055cc #0055cc #003580; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + background-color: #0055cc; +} +.btn-primary:active, +.btn-primary.active { + background-color: #004099 \9; +} +.btn-warning { + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -ms-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(top, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + background-color: #f89406; +} +.btn-warning:active, +.btn-warning.active { + background-color: #c67605 \9; +} +.btn-danger { + background-color: #da4f49; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(top, #ee5f5b, #bd362f); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + background-color: #bd362f; +} +.btn-danger:active, +.btn-danger.active { + background-color: #942a25 \9; +} +.btn-success { + background-color: #5bb75b; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -ms-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(top, #62c462, #51a351); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-success:hover, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + background-color: #51a351; +} +.btn-success:active, +.btn-success.active { + background-color: #408140 \9; +} +.btn-info { + background-color: #49afcd; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(top, #5bc0de, #2f96b4); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-info:hover, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + background-color: #2f96b4; +} +.btn-info:active, +.btn-info.active { + background-color: #24748c \9; +} +.btn-inverse { + background-color: #414141; + background-image: -moz-linear-gradient(top, #555555, #222222); + background-image: -ms-linear-gradient(top, #555555, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222)); + background-image: -webkit-linear-gradient(top, #555555, #222222); + background-image: -o-linear-gradient(top, #555555, #222222); + background-image: linear-gradient(top, #555555, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0); + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); +} +.btn-inverse:hover, +.btn-inverse:active, +.btn-inverse.active, +.btn-inverse.disabled, +.btn-inverse[disabled] { + background-color: #222222; +} +.btn-inverse:active, +.btn-inverse.active { + background-color: #080808 \9; +} +button.btn, +input[type="submit"].btn { + *padding-top: 2px; + *padding-bottom: 2px; +} +button.btn::-moz-focus-inner, +input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} +button.btn.btn-large, +input[type="submit"].btn.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; +} +button.btn.btn-small, +input[type="submit"].btn.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; +} +button.btn.btn-mini, +input[type="submit"].btn.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; +} +.btn-group { + position: relative; + *zoom: 1; + *margin-left: .3em; +} +.btn-group:before, +.btn-group:after { + display: table; + content: ""; +} +.btn-group:after { + clear: both; +} +.btn-group:first-child { + *margin-left: 0; +} +.btn-group + .btn-group { + margin-left: 5px; +} +.btn-toolbar { + margin-top: 9px; + margin-bottom: 9px; +} +.btn-toolbar .btn-group { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} +.btn-group .btn { + position: relative; + float: left; + margin-left: -1px; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.btn-group .btn:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.btn-group .btn:last-child, +.btn-group .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; +} +.btn-group .btn.large:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 6px; + -moz-border-radius-topleft: 6px; + border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + border-bottom-left-radius: 6px; +} +.btn-group .btn.large:last-child, +.btn-group .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + -moz-border-radius-topright: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + -moz-border-radius-bottomright: 6px; + border-bottom-right-radius: 6px; +} +.btn-group .btn:hover, +.btn-group .btn:focus, +.btn-group .btn:active, +.btn-group .btn.active { + z-index: 2; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + *padding-top: 3px; + *padding-bottom: 3px; +} +.btn-group .btn-mini.dropdown-toggle { + padding-left: 5px; + padding-right: 5px; + *padding-top: 1px; + *padding-bottom: 1px; +} +.btn-group .btn-small.dropdown-toggle { + *padding-top: 4px; + *padding-bottom: 4px; +} +.btn-group .btn-large.dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open { + *z-index: 1000; +} +.btn-group.open .dropdown-menu { + display: block; + margin-top: 1px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn .caret { + margin-top: 7px; + margin-left: 0; +} +.btn:hover .caret, +.open.btn-group .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.btn-mini .caret { + margin-top: 5px; +} +.btn-small .caret { + margin-top: 6px; +} +.btn-large .caret { + margin-top: 6px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 0.75; + filter: alpha(opacity=75); +} +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 18px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: #c09853; +} +.alert-heading { + color: inherit; +} +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 18px; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #468847; +} +.alert-danger, +.alert-error { + background-color: #f2dede; + border-color: #eed3d7; + color: #b94a48; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #3a87ad; +} +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} +.alert-block > p, +.alert-block > ul { + margin-bottom: 0; +} +.alert-block p + p { + margin-top: 5px; +} +.nav { + margin-left: 0; + margin-bottom: 18px; + list-style: none; +} +.nav > li > a { + display: block; +} +.nav > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} +.nav .nav-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 18px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} +.nav li + .nav-header { + margin-top: 9px; +} +.nav-list { + padding-left: 15px; + padding-right: 15px; + margin-bottom: 0; +} +.nav-list > li > a, +.nav-list .nav-header { + margin-left: -15px; + margin-right: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.nav-list > li > a { + padding: 3px 15px; +} +.nav-list > .active > a, +.nav-list > .active > a:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; +} +.nav-list [class^="icon-"] { + margin-right: 2px; +} +.nav-list .divider { + height: 1px; + margin: 8px 1px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; + *width: 100%; + *margin: -5px 0 5px; +} +.nav-tabs, +.nav-pills { + *zoom: 1; +} +.nav-tabs:before, +.nav-pills:before, +.nav-tabs:after, +.nav-pills:after { + display: table; + content: ""; +} +.nav-tabs:after, +.nav-pills:after { + clear: both; +} +.nav-tabs > li, +.nav-pills > li { + float: left; +} +.nav-tabs > li > a, +.nav-pills > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + margin-bottom: -1px; +} +.nav-tabs > li > a { + padding-top: 8px; + padding-bottom: 8px; + line-height: 18px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > .active > a, +.nav-tabs > .active > a:hover { + color: #555555; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-pills > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: #ffffff; + background-color: #0088cc; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li > a { + margin-right: 0; +} +.nav-tabs.nav-stacked { + border-bottom: 0; +} +.nav-tabs.nav-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.nav-tabs.nav-stacked > li:first-child > a { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.nav-tabs.nav-stacked > li:last-child > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.nav-tabs.nav-stacked > li > a:hover { + border-color: #ddd; + z-index: 2; +} +.nav-pills.nav-stacked > li > a { + margin-bottom: 3px; +} +.nav-pills.nav-stacked > li:last-child > a { + margin-bottom: 1px; +} +.nav-tabs .dropdown-menu, +.nav-pills .dropdown-menu { + margin-top: 1px; + border-width: 1px; +} +.nav-pills .dropdown-menu { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.nav-tabs .dropdown-toggle .caret, +.nav-pills .dropdown-toggle .caret { + border-top-color: #0088cc; + border-bottom-color: #0088cc; + margin-top: 6px; +} +.nav-tabs .dropdown-toggle:hover .caret, +.nav-pills .dropdown-toggle:hover .caret { + border-top-color: #005580; + border-bottom-color: #005580; +} +.nav-tabs .active .dropdown-toggle .caret, +.nav-pills .active .dropdown-toggle .caret { + border-top-color: #333333; + border-bottom-color: #333333; +} +.nav > .dropdown.active > a:hover { + color: #000000; + cursor: pointer; +} +.nav-tabs .open .dropdown-toggle, +.nav-pills .open .dropdown-toggle, +.nav > .open.active > a:hover { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} +.nav .open .caret, +.nav .open.active .caret, +.nav .open a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} +.tabs-stacked .open > a:hover { + border-color: #999999; +} +.tabbable { + *zoom: 1; +} +.tabbable:before, +.tabbable:after { + display: table; + content: ""; +} +.tabbable:after { + clear: both; +} +.tab-content { + display: table; + width: 100%; +} +.tabs-below .nav-tabs, +.tabs-right .nav-tabs, +.tabs-left .nav-tabs { + border-bottom: 0; +} +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} +.tab-content > .active, +.pill-content > .active { + display: block; +} +.tabs-below .nav-tabs { + border-top: 1px solid #ddd; +} +.tabs-below .nav-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} +.tabs-below .nav-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-below .nav-tabs > li > a:hover { + border-bottom-color: transparent; + border-top-color: #ddd; +} +.tabs-below .nav-tabs .active > a, +.tabs-below .nav-tabs .active > a:hover { + border-color: transparent #ddd #ddd #ddd; +} +.tabs-left .nav-tabs > li, +.tabs-right .nav-tabs > li { + float: none; +} +.tabs-left .nav-tabs > li > a, +.tabs-right .nav-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} +.tabs-left .nav-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} +.tabs-left .nav-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-left .nav-tabs > li > a:hover { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} +.tabs-left .nav-tabs .active > a, +.tabs-left .nav-tabs .active > a:hover { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} +.tabs-right .nav-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} +.tabs-right .nav-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-right .nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} +.tabs-right .nav-tabs .active > a, +.tabs-right .nav-tabs .active > a:hover { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} +.navbar { + *position: relative; + *z-index: 2; + overflow: visible; + margin-bottom: 18px; +} +.navbar-inner { + padding-left: 20px; + padding-right: 20px; + background-color: #2c2c2c; + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); +} +.navbar .container { + width: auto; +} +.btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-left: 5px; + margin-right: 5px; + background-color: #2c2c2c; + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:dximagetransform.microsoft.gradient(enabled=false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} +.btn-navbar:hover, +.btn-navbar:active, +.btn-navbar.active, +.btn-navbar.disabled, +.btn-navbar[disabled] { + background-color: #222222; +} +.btn-navbar:active, +.btn-navbar.active { + background-color: #080808 \9; +} +.btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} +.nav-collapse.collapse { + height: auto; +} +.navbar { + color: #999999; +} +.navbar .brand:hover { + text-decoration: none; +} +.navbar .brand { + float: left; + display: block; + padding: 8px 20px 12px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + line-height: 1; + color: #ffffff; +} +.navbar .navbar-text { + margin-bottom: 0; + line-height: 40px; +} +.navbar .btn, +.navbar .btn-group { + margin-top: 5px; +} +.navbar .btn-group .btn { + margin-top: 0; +} +.navbar-form { + margin-bottom: 0; + *zoom: 1; +} +.navbar-form:before, +.navbar-form:after { + display: table; + content: ""; +} +.navbar-form:after { + clear: both; +} +.navbar-form input, +.navbar-form select, +.navbar-form .radio, +.navbar-form .checkbox { + margin-top: 5px; +} +.navbar-form input, +.navbar-form select { + display: inline-block; + margin-bottom: 0; +} +.navbar-form input[type="image"], +.navbar-form input[type="checkbox"], +.navbar-form input[type="radio"] { + margin-top: 3px; +} +.navbar-form .input-append, +.navbar-form .input-prepend { + margin-top: 6px; + white-space: nowrap; +} +.navbar-form .input-append input, +.navbar-form .input-prepend input { + margin-top: 0; +} +.navbar-search { + position: relative; + float: left; + margin-top: 6px; + margin-bottom: 0; +} +.navbar-search .search-query { + padding: 4px 9px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + color: #ffffff; + background-color: #626262; + border: 1px solid #151515; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; +} +.navbar-search .search-query:-moz-placeholder { + color: #cccccc; +} +.navbar-search .search-query::-webkit-input-placeholder { + color: #cccccc; +} +.navbar-search .search-query:focus, +.navbar-search .search-query.focused { + padding: 5px 10px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + outline: 0; +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; +} +.navbar-fixed-top .navbar-inner, +.navbar-fixed-bottom .navbar-inner { + padding-left: 0; + padding-right: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} +.navbar-fixed-top { + top: 0; +} +.navbar-fixed-bottom { + bottom: 0; +} +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} +.navbar .nav.pull-right { + float: right; +} +.navbar .nav > li { + display: block; + float: left; +} +.navbar .nav > li > a { + float: none; + padding: 10px 10px 11px; + line-height: 19px; + color: #999999; + text-decoration: none; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.navbar .nav > li > a:hover { + background-color: transparent; + color: #ffffff; + text-decoration: none; +} +.navbar .nav .active > a, +.navbar .nav .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #222222; +} +.navbar .divider-vertical { + height: 40px; + width: 1px; + margin: 0 9px; + overflow: hidden; + background-color: #222222; + border-right: 1px solid #333333; +} +.navbar .nav.pull-right { + margin-left: 10px; + margin-right: 0; +} +.navbar .dropdown-menu { + margin-top: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.navbar .dropdown-menu:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + top: -7px; + left: 9px; +} +.navbar .dropdown-menu:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + position: absolute; + top: -6px; + left: 10px; +} +.navbar-fixed-bottom .dropdown-menu:before { + border-top: 7px solid #ccc; + border-top-color: rgba(0, 0, 0, 0.2); + border-bottom: 0; + bottom: -7px; + top: auto; +} +.navbar-fixed-bottom .dropdown-menu:after { + border-top: 6px solid #ffffff; + border-bottom: 0; + bottom: -6px; + top: auto; +} +.navbar .nav .dropdown-toggle .caret, +.navbar .nav .open.dropdown .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} +.navbar .nav .active .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.navbar .nav .open > .dropdown-toggle, +.navbar .nav .active > .dropdown-toggle, +.navbar .nav .open.active > .dropdown-toggle { + background-color: transparent; +} +.navbar .nav .active > .dropdown-toggle:hover { + color: #ffffff; +} +.navbar .nav.pull-right .dropdown-menu, +.navbar .nav .dropdown-menu.pull-right { + left: auto; + right: 0; +} +.navbar .nav.pull-right .dropdown-menu:before, +.navbar .nav .dropdown-menu.pull-right:before { + left: auto; + right: 12px; +} +.navbar .nav.pull-right .dropdown-menu:after, +.navbar .nav .dropdown-menu.pull-right:after { + left: auto; + right: 13px; +} +.breadcrumb { + padding: 7px 14px; + margin: 0 0 18px; + list-style: none; + background-color: #fbfbfb; + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); + background-image: linear-gradient(top, #ffffff, #f5f5f5); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); + border: 1px solid #ddd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} +.breadcrumb li { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + text-shadow: 0 1px 0 #ffffff; +} +.breadcrumb .divider { + padding: 0 5px; + color: #999999; +} +.breadcrumb .active a { + color: #333333; +} +.pagination { + height: 36px; + margin: 18px 0; +} +.pagination ul { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-left: 0; + margin-bottom: 0; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.pagination li { + display: inline; +} +.pagination a { + float: left; + padding: 0 14px; + line-height: 34px; + text-decoration: none; + border: 1px solid #ddd; + border-left-width: 0; +} +.pagination a:hover, +.pagination .active a { + background-color: #f5f5f5; +} +.pagination .active a { + color: #999999; + cursor: default; +} +.pagination .disabled span, +.pagination .disabled a, +.pagination .disabled a:hover { + color: #999999; + background-color: transparent; + cursor: default; +} +.pagination li:first-child a { + border-left-width: 1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.pagination li:last-child a { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.pagination-centered { + text-align: center; +} +.pagination-right { + text-align: right; +} +.pager { + margin-left: 0; + margin-bottom: 18px; + list-style: none; + text-align: center; + *zoom: 1; +} +.pager:before, +.pager:after { + display: table; + content: ""; +} +.pager:after { + clear: both; +} +.pager li { + display: inline; +} +.pager a { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.pager a:hover { + text-decoration: none; + background-color: #f5f5f5; +} +.pager .next a { + float: right; +} +.pager .previous a { + float: left; +} +.pager .disabled a, +.pager .disabled a:hover { + color: #999999; + background-color: #fff; + cursor: default; +} +.modal-open .dropdown-menu { + z-index: 2050; +} +.modal-open .dropdown.open { + *z-index: 2050; +} +.modal-open .popover { + z-index: 2060; +} +.modal-open .tooltip { + z-index: 2070; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; +} +.modal-backdrop, +.modal-backdrop.fade.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.modal { + position: fixed; + top: 50%; + left: 50%; + z-index: 1050; + overflow: auto; + width: 560px; + margin: -250px 0 0 -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + /* IE6-7 */ + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.modal.fade { + -webkit-transition: opacity .3s linear, top .3s ease-out; + -moz-transition: opacity .3s linear, top .3s ease-out; + -ms-transition: opacity .3s linear, top .3s ease-out; + -o-transition: opacity .3s linear, top .3s ease-out; + transition: opacity .3s linear, top .3s ease-out; + top: -25%; +} +.modal.fade.in { + top: 50%; +} +.modal-header { + padding: 9px 15px; + border-bottom: 1px solid #eee; +} +.modal-header .close { + margin-top: 2px; +} +.modal-body { + overflow-y: auto; + max-height: 400px; + padding: 15px; +} +.modal-form { + margin-bottom: 0; +} +.modal-footer { + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; + *zoom: 1; +} +.modal-footer:before, +.modal-footer:after { + display: table; + content: ""; +} +.modal-footer:after { + clear: both; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.tooltip { + position: absolute; + z-index: 1020; + display: block; + visibility: visible; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.tooltip.top { + margin-top: -2px; +} +.tooltip.right { + margin-left: 2px; +} +.tooltip.bottom { + margin-top: 2px; +} +.tooltip.left { + margin-left: -2px; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + padding: 5px; +} +.popover.top { + margin-top: -5px; +} +.popover.right { + margin-left: 5px; +} +.popover.bottom { + margin-top: 5px; +} +.popover.left { + margin-left: -5px; +} +.popover.top .arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.popover.right .arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.popover.bottom .arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.popover.left .arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.popover .arrow { + position: absolute; + width: 0; + height: 0; +} +.popover-inner { + padding: 3px; + width: 280px; + overflow: hidden; + background: #000000; + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); +} +.popover-title { + padding: 9px 15px; + line-height: 1; + background-color: #f5f5f5; + border-bottom: 1px solid #eee; + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; +} +.popover-content { + padding: 14px; + background-color: #ffffff; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.popover-content p, +.popover-content ul, +.popover-content ol { + margin-bottom: 0; +} +.thumbnails { + margin-left: -20px; + list-style: none; + *zoom: 1; +} +.thumbnails:before, +.thumbnails:after { + display: table; + content: ""; +} +.thumbnails:after { + clear: both; +} +.thumbnails > li { + float: left; + margin: 0 0 18px 20px; +} +.thumbnail { + display: block; + padding: 4px; + line-height: 1; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); +} +a.thumbnail:hover { + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} +.thumbnail > img { + display: block; + max-width: 100%; + margin-left: auto; + margin-right: auto; +} +.thumbnail .caption { + padding: 9px; +} +.label { + padding: 1px 4px 2px; + font-size: 10.998px; + font-weight: bold; + line-height: 13px; + color: #ffffff; + vertical-align: middle; + white-space: nowrap; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #999999; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.label:hover { + color: #ffffff; + text-decoration: none; +} +.label-important { + background-color: #b94a48; +} +.label-important:hover { + background-color: #953b39; +} +.label-warning { + background-color: #f89406; +} +.label-warning:hover { + background-color: #c67605; +} +.label-success { + background-color: #468847; +} +.label-success:hover { + background-color: #356635; +} +.label-info { + background-color: #3a87ad; +} +.label-info:hover { + background-color: #2d6987; +} +.label-inverse { + background-color: #333333; +} +.label-inverse:hover { + background-color: #1a1a1a; +} +.badge { + padding: 1px 9px 2px; + font-size: 12.025px; + font-weight: bold; + white-space: nowrap; + color: #ffffff; + background-color: #999999; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; +} +.badge:hover { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.badge-error { + background-color: #b94a48; +} +.badge-error:hover { + background-color: #953b39; +} +.badge-warning { + background-color: #f89406; +} +.badge-warning:hover { + background-color: #c67605; +} +.badge-success { + background-color: #468847; +} +.badge-success:hover { + background-color: #356635; +} +.badge-info { + background-color: #3a87ad; +} +.badge-info:hover { + background-color: #2d6987; +} +.badge-inverse { + background-color: #333333; +} +.badge-inverse:hover { + background-color: #1a1a1a; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@-moz-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@-ms-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +.progress { + overflow: hidden; + height: 18px; + margin-bottom: 18px; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(top, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.progress .bar { + width: 0%; + height: 18px; + color: #ffffff; + font-size: 12px; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -ms-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(top, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -ms-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .bar { + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-danger .bar { + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(top, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); +} +.progress-danger.progress-striped .bar { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-success .bar { + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -ms-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(top, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); +} +.progress-success.progress-striped .bar { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-info .bar { + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(top, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); +} +.progress-info.progress-striped .bar { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-warning .bar { + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -ms-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(top, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); +} +.progress-warning.progress-striped .bar { + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.accordion { + margin-bottom: 18px; +} +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.accordion-heading { + border-bottom: 0; +} +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} +.carousel { + position: relative; + margin-bottom: 18px; + line-height: 1; +} +.carousel-inner { + overflow: hidden; + width: 100%; + position: relative; +} +.carousel .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -ms-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel .item > img { + display: block; + line-height: 1; +} +.carousel .active, +.carousel .next, +.carousel .prev { + display: block; +} +.carousel .active { + left: 0; +} +.carousel .next, +.carousel .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel .next { + left: 100%; +} +.carousel .prev { + left: -100%; +} +.carousel .next.left, +.carousel .prev.right { + left: 0; +} +.carousel .active.left { + left: -100%; +} +.carousel .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); +} +.carousel-control.right { + left: auto; + right: 15px; +} +.carousel-control:hover { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-caption { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: 10px 15px 5px; + background: #333333; + background: rgba(0, 0, 0, 0.75); +} +.carousel-caption h4, +.carousel-caption p { + color: #ffffff; +} +.hero-unit { + padding: 60px; + margin-bottom: 30px; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.hero-unit h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + color: inherit; + letter-spacing: -1px; +} +.hero-unit p { + font-size: 18px; + font-weight: 200; + line-height: 27px; + color: inherit; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.hide { + display: none; +} +.show { + display: block; +} +.invisible { + visibility: hidden; +} diff --git a/src/css/common.css b/src/css/common.css new file mode 100644 index 0000000..d894d1d --- /dev/null +++ b/src/css/common.css @@ -0,0 +1,128 @@ +html, +body { + margin: 0; + padding: 0; +} + +* { + font-family: 'Roboto', sans-serif; +} + +.inline { + display: inline-block; +} + +.hide { + display: none !important; +} + +input { + margin-bottom: initial; +} + +h1, h2 { + font-weight: lighter; +} + +#heading-wrap { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 50px; + background-color: #eee; + border-bottom: 1px solid #ccc; + z-index: 1; +} + +#heading { + width: 100%; +} + +#heading-logo-wrap, +#heading-text-wrap, +#heading-settings-wrap { + display: inline-block; +} + +#heading-logo-wrap { + vertical-align: top; +} + +#heading-logo { + width: 30px; + height: 30px; + padding: 10px; +} + +#heading-text-wrap { + font-size: 20px; + line-height: 50px; + padding-left: 10px; +} + +#heading-settings-wrap { + width: 30px; + height: 30px; + padding: 10px; + float: right; + right: 0; + position: absolute; +} + +#heading-settings { + transition: transform 0.1s ease-in-out; +} + +#heading-settings:hover { + transform: rotate(90deg); +} + +#content { + width: 100%; + max-width: 1024px; + padding: 15px; + margin: 65px auto 20px auto; + box-sizing: border-box; + background-color: #fafafa; + border-radius: 5px; + border: 1px solid #ccc; +} + +@media (max-width: 1024px) { + body { + background-color: #fafafa; + } + + #content { + border-radius: initial; + border: 1px solid #fafafa; + margin: 65px auto 0 auto; + } +} + +#main-image-left.fill-fade, +#main-image-right.fill-fade { + transition: fill 0.5s ease-in-out; +} + +button { + border: 1px solid #ccc; + background-color: #fff; + outline: none; + border-radius: 5px; + padding: 5px; + cursor: pointer; +} + +button#temp-trust-domain { + background-color: #fff; + border: 1px solid #db2d2d; + color: #db2d2d; +} + +button#trust-domain { + background-color: #d70000; + border: 1px solid #d70000; + color: #fff; +} diff --git a/src/css/fonts.css b/src/css/fonts.css new file mode 100644 index 0000000..136303d --- /dev/null +++ b/src/css/fonts.css @@ -0,0 +1,15 @@ +/* Generated with: https://google-webfonts-helper.herokuapp.com/ */ + +/* roboto-regular - latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: url('../fonts/roboto-v27-latin-regular.eot'); /* IE9 Compat Modes */ + src: local(''), + url('../fonts/roboto-v27-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/roboto-v27-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/roboto-v27-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/roboto-v27-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/roboto-v27-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */ +} \ No newline at end of file diff --git a/src/css/popup.css b/src/css/popup.css new file mode 100644 index 0000000..b32e796 --- /dev/null +++ b/src/css/popup.css @@ -0,0 +1,78 @@ +body, html { + margin: 0; + padding: 0; + background-color: #fafafa; + overflow-x: hidden; +} + +button { + width: 200px; + text-align: center; + display: block; + margin: 10px auto; +} + +#content { + width: 600px; + overflow-x: hidden; +} + +#content.pad { + margin-right: 17px; +} + +#main-image { + width: 200px; + margin: 0 auto; + display: block; +} + +#domain-trust-label { + font-size: 20px; + padding: 19px 5px 0 5px; + text-align: center; +} + +#domain-trust-rule-label { + margin-bottom: 25px; +} + +#domain-expires-label:not(:empty) { + font-size: 15px; + padding: 19px 5px 0 5px; + text-align: center; +} + +#trust-subdomains-wrap { + text-align: center; +} + +button#temp-trust-domain { + margin-top: 30px; +} + +#domain-trust-rule-table { + padding-top: 20px; + border-collapse: collapse; + width: 100%; +} + +#domain-trust-rule-text { + margin: 20px 0 3px 0; +} + +#domain-trust-rule-table td { + border: 1px solid #ccc; +} + +.domain-trust-header { + text-align: right; + background-color: #eee; + width: 135px; + padding: 3px; +} + +.domain-trust-value { + padding-left: 5px; + word-wrap: anywhere; +} diff --git a/src/css/settings.css b/src/css/settings.css new file mode 100644 index 0000000..6ba1172 --- /dev/null +++ b/src/css/settings.css @@ -0,0 +1,270 @@ +/* Overrides */ + +#content { + border-top: none; +} + +.popup #content { + width: 600px; + overflow-x: hidden; +} + +#content.pad { + margin-right: 17px; +} + +/* Settings Tabs */ + +#tabs-wrap { + position: relative; + top: -15px; + left: -15px; + width: calc(100% + 30px); + background-color: #fff; + white-space: nowrap; + border-radius: 5px; + background-color: #fafafa; +} + +.tab { + border-bottom: 1px solid #ccc; + padding: 15px; + display: inline-block; + width: 33.333%; + box-sizing: border-box; + user-select: none; + -moz-user-select: none; + cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; + background-color: #fff; + vertical-align: middle; + border-top: 1px solid #ccc; +} + +.tab.selected { + border-top: 2px solid #0abbff; + background-color: #fafafa; + border-right: 1px solid #ccc; + border-bottom: 1px solid #fafafa; + padding: 14px 15px 15px 15px; +} + +.tab-2.selected { + border-left: 1px solid #ccc; + padding: 14px 15px 15px 14px; +} + +.tab-3.selected { + border-left: 1px solid #ccc; + border-right: none; + padding: 14px 15px 15px 14px; +} + +.tab-1 { + border-top-left-radius: 5px; +} + +.tab-2, +.tab-3 { + margin-left: -4px; +} + +.tab-3 { + border-top-right-radius: 5px; +} + +.tab:not(.selected):hover { + padding-top: 14px; + border-top: 2px solid #ccc; + background-color: #f8f8f8; +} + +@media (max-width: 1024px) { + #content { + margin: 50px auto 0 auto; + border-radius: initial; + } + + #tabs-wrap { + padding-top: 14px; + background-color: white; + border-top: 1px solid #ccc; + border-radius: initial; + } + + .tab { + border-top: none; + } + + .tab-1 { + border-top-left-radius: initial; + } + + .tab-3 { + border-top-right-radius: initial; + } +} + +/* Sections */ + +.section { + display: none; +} + +.section.selected { + display: block; +} + +/* Trusted Domain List */ + +#trusted-domains-list { + display: table; + width: 100%; + border-collapse: collapse; +} + +.trusted-domain-list-heading-field { + text-transform: uppercase; + font-size: 10px; + vertical-align: bottom; +} + +.trusted-domain-list-heading-row { + border-bottom: 1px solid #ccc; +} + +.trusted-domain-list-heading-row, +.trusted-domain-list-row { + display: table-row; +} + +.trusted-domain-list-row { + border-radius: 5px; +} + +.trusted-domain-list-row:hover { + background-color: #eee; +} + +.trusted-domain-list-heading-field, +.trusted-domain-list-row-domain, +.trusted-domain-list-row-subdomain, +.trusted-domain-list-row-expires, +.trusted-domain-list-row-options { + display: table-cell; +} + +.trusted-domain-list-row-domain, +.trusted-domain-list-row-subdomain, +.trusted-domain-list-row-expires, +.trusted-domain-list-row-options { + padding: 3px 0; +} + +#trust-subdomain-header { + width: 70px; + text-align: center; + padding: 0 10px; + vertical-align: bottom; +} + +.trusted-domain-list-row-subdomain, +.trusted-domain-list-row-options, +.trusted-domain-list-row-expires { + text-align: center; +} + +.trusted-domain-list-row-expires-text { + text-overflow: ellipsis; + white-space: nowrap; + width: 100px; + overflow: hidden; + display: block; + text-transform: uppercase; + font-size: 13px; +} + +#edit-header { + width: 100px; + text-align: center; +} + +#expires-header { + width: 100px; + text-align: center; +} + +.trusted-domain-list-domain-input { + width: 100%; + background-color: #fafafa; + border: 0; + margin-left: 5px; +} + +#new-trusted-domain-input { + background-color: #fff; + border-radius: 3px; +} + +#new-trusted-domain-input:not(:active):not(:focus) { + border: 1px solid #ccc; +} + +/* Settings Section */ + +.setting-group-title { + margin-top: 10px; + border-bottom: 1px solid #ccc; + font-size: 20px; + color: #5b5b5b; + text-transform: uppercase; +} + +.setting-group-title:not(:first-of-type) { + margin-top: 30px; +} + +.setting-wrap { + padding: 20px 0 0 10px; +} + +.setting-description { + font-size: 13px; + color: #5b5b5b; + padding-top: 5px; +} + +#import-domains-file { + display: block; + padding-bottom: 10px; +} + +/* About Section */ + +#about-section { + text-align: center; +} + +#main-image-wrap { + padding: 20px 0; +} + +#main-image { + width: 200px; + height: 200px; + margin: 0 auto; + display: block; +} + +#license { + width: 100%; + max-width: 550px; + text-align: left; + margin: 0 auto; +} + +#license span, +#license a { + font-family: 'Courier New', Courier, monospace; +} diff --git a/src/fonts/roboto-v27-latin-regular.eot b/src/fonts/roboto-v27-latin-regular.eot new file mode 100644 index 0000000..6dd5e3a Binary files /dev/null and b/src/fonts/roboto-v27-latin-regular.eot differ diff --git a/src/fonts/roboto-v27-latin-regular.svg b/src/fonts/roboto-v27-latin-regular.svg new file mode 100644 index 0000000..627f5a3 --- /dev/null +++ b/src/fonts/roboto-v27-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fonts/roboto-v27-latin-regular.ttf b/src/fonts/roboto-v27-latin-regular.ttf new file mode 100644 index 0000000..637971a Binary files /dev/null and b/src/fonts/roboto-v27-latin-regular.ttf differ diff --git a/src/fonts/roboto-v27-latin-regular.woff b/src/fonts/roboto-v27-latin-regular.woff new file mode 100644 index 0000000..86b3863 Binary files /dev/null and b/src/fonts/roboto-v27-latin-regular.woff differ diff --git a/src/fonts/roboto-v27-latin-regular.woff2 b/src/fonts/roboto-v27-latin-regular.woff2 new file mode 100644 index 0000000..ebe1795 Binary files /dev/null and b/src/fonts/roboto-v27-latin-regular.woff2 differ diff --git a/src/html/background.html b/src/html/background.html new file mode 100644 index 0000000..580495c --- /dev/null +++ b/src/html/background.html @@ -0,0 +1,13 @@ + + + + Browser Guard + + + + + + + background + + diff --git a/src/html/blocked.html b/src/html/blocked.html new file mode 100644 index 0000000..28aafdf --- /dev/null +++ b/src/html/blocked.html @@ -0,0 +1,93 @@ + + + + Browser Guard + + + + + + + + + + + + + + + + __MSG_extensionName__ + + + + + + + + + + + + + + + + + + + + + + + + + __MSG_copy__ + + + + __MSG_backToSafety__ + + + __MSG_trustAndContinue__ + + + __MSG_tempTrustAndContinue__ + + + + __MSG_alsoTrustSubdomains__ + + + + __MSG_details__ + + + __MSG_requestUrl__ + + + + __MSG_originUrl__ + + + + __MSG_method__ + + + + __MSG_urlClassifications__ + + + + + + + diff --git a/src/html/popup.html b/src/html/popup.html new file mode 100644 index 0000000..6ad807e --- /dev/null +++ b/src/html/popup.html @@ -0,0 +1,91 @@ + + + + Browser Guard + + + + + + + + + + + + + + + + + Browser Guard + + + + + + + + + + + + + + + + + + + + + + + + __MSG_domainTrustedBuRule__ + + __MSG_domain__ + + + + __MSG_trustSubdomains__ + + + + __MSG_expires__ + + + + + + + __MSG_backToSafety__ + + + __MSG_trustTemporarily__ + + + __MSG_trustPermanently__ + + + __MSG_removeTrust__ + + + + __MSG_alsoTrustSubdomains__ + + + + + diff --git a/src/html/settings.html b/src/html/settings.html new file mode 100644 index 0000000..70321b0 --- /dev/null +++ b/src/html/settings.html @@ -0,0 +1,251 @@ + + + + Browser Guard - Settings + + + + + + + + + + + + + + + + + + __MSG_extensionName__ - __MSG_settings__ + + + + + + + + + + + + __MSG_trustedDomains__ + + + __MSG_settings__ + + + __MSG_about__ + + + + + + + + + __MSG_domain__ + + + __MSG_trustSubdomains__ + + + __MSG_expires__ + + + __MSG_options__ + + + + + + + + + + + + __MSG_never__ + 1 __MSG_minute__ + 5 __MSG_minutes__ + 10 __MSG_minutes__ + 30 __MSG_minutes__ + 60 __MSG_minutes__ + 90 __MSG_minutes__ + 24 __MSG_hours__ + + + + + __MSG_addTrust__ + + + + + + + + + __MSG_trustSettings__ + + + + + __MSG_trustSubdomainsDefault__ + __MSG_checkTrustSubdomains__ + + + + + + __MSG_ignoreWwwSubdomain__ + __MSG_removeWwwDesc__ + + + + + __MSG_tempTrustDuration__ + + 1 __MSG_minute__ + 5 __MSG_minutes__ + 10 __MSG_minutes__ + 30 __MSG_minutes__ + 60 __MSG_minutes__ + 90 __MSG_minutes__ + 24 __MSG_hours__ + + __MSG_tempTrustDurationDesc__ + + + + + + __MSG_tempTrustDefault__ + __MSG_tempTrustDefaultDesc__ + + + __MSG_importExportSync__ + + + + + + __MSG_importTrustedDomains__ + + + __MSG_importTrustedDomainsDesc__ + + + + + + + __MSG_exportTrustedDomains__ + + + __MSG_exportTrustedDomainsDesc__ + + + + __MSG_resetSettingsTitle__ + + + + + __MSG_resetTrustedDomains__ + + + __MSG_resetTrustedDomainsDesc__ + + + + + + __MSG_resetSettings__ + __MSG_resetSettingsDesc__ + + + + + + + + + + __MSG_extensionName__ + __MSG_version__ TBD + __MSG_extensionTagline__ + + + __MSG_viewSource__ + GitHub. + + + + __MSG_createdBy__ + @jdgregson + __MSG_for__ + PhishAnatomy. + + + + + + __MSG_licenseBlock1__ + + __MSG_licenseBlock2__ + + __MSG_licenseBlock3__ + https://www.gnu.org/licenses/. + + + + + diff --git a/src/manifest.json b/src/manifest.json new file mode 100644 index 0000000..1420818 --- /dev/null +++ b/src/manifest.json @@ -0,0 +1,39 @@ +{ + "name": "__MSG_extensionName__", + "description": "__MSG_extensionDescription__", + "default_locale": "en", + "version": "0.0.1", + "manifest_version": 2, + "content_security_policy": "default-src \u0027self\u0027;", + "icons": { + "16": "art/browser-guard.svg", + "24": "art/browser-guard.svg", + "32": "art/browser-guard.svg", + "48": "art/browser-guard.svg", + "64": "art/browser-guard.svg", + "128": "art/browser-guard.svg", + "256": "art/browser-guard.svg" + }, + "browser_action": { + "default_icon": { + "16": "art/browser-guard.svg", + "24": "art/browser-guard.svg", + "32": "art/browser-guard.svg", + "48": "art/browser-guard.svg", + "64": "art/browser-guard.svg" + }, + "default_popup": "html/popup.html" + }, + "permissions": [ + "tabs", + "webRequest", + "history", + "webRequestBlocking", + "storage", + "\u003call_urls\u003e" + ], + "background": { + "page": "html/background.html", + "persistent": true + } +} diff --git a/src/ts/background.ts b/src/ts/background.ts new file mode 100644 index 0000000..73e7977 --- /dev/null +++ b/src/ts/background.ts @@ -0,0 +1,98 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +/** + * Called when any tab sends a request to load a page. + * + * @param {FullWebRequestBodyDetails} details The details of the request. + * @return {chrome.webRequest.BlockingResponse} The action the browser should + * take, i.e. block, redirect, or take no action. + */ +const onRequestStart = ( + details: FullWebRequestBodyDetails +): chrome.webRequest.BlockingResponse => { + const requestDomain = new URL(details.url).hostname; + if ( + !isTrustedDomain( + requestDomain, + trustedDomains, + background_settings.ignoreWww + ) + ) { + const redirectUrl = getExtensionURL('html/blocked.html'); + const finalUrl = new URL(redirectUrl); + finalUrl.searchParams.append('request_url', btoa(details.url)); + finalUrl.searchParams.append('origin_url', btoa(details.originUrl)); + finalUrl.searchParams.append('method', btoa(details.method)); + finalUrl.searchParams.append( + 'url_classification', + btoa(JSON.stringify(details.urlClassification)) + ); + if (isFirefox()) { + chrome.tabs.update(details.tabId, {url: finalUrl.toString()}); + return {cancel: true}; + } else { + return {redirectUrl: finalUrl.toString()}; + } + } else { + return {cancel: false}; + } +}; + +// Load settings +let background_settings: BrowserGuardSettings; +getSettings((storedSettings) => { + background_settings = storedSettings; +}); + +// Reload settings when they are changes +browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_SETTINGS) > -1) { + background_settings = JSON.parse(changes[STORAGE_SETTINGS].newValue); + } +}); + +// Load trusted domains from storage +let trustedDomains: TrustedDomain[] = []; +getTrustedDomains((savedTrustedDomains) => { + trustedDomains = removeExpiredTrustedDomains(savedTrustedDomains); +}); + +// Reload trusted domains when they are changed +browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_TRUSTED_DOMAINS) > -1) { + trustedDomains = JSON.parse(changes[STORAGE_TRUSTED_DOMAINS].newValue); + trustedDomains = removeExpiredTrustedDomains(trustedDomains); + } +}); + +// Collect garbage +const garbageCollector = self.setInterval(() => { + // Remove trusted domains whose trust has expired + getTrustedDomains((trustedDomains: TrustedDomain[]) => { + const cleanedTrustedDomains = removeExpiredTrustedDomains(trustedDomains); + if (cleanedTrustedDomains.length < trustedDomains.length) { + setTrustedDomains(cleanedTrustedDomains); + } + }, false); +}, 60000 * 5); + +window.addEventListener('load', () => { + // Add listeners for request events so we can block untrusted requests before + // they are made + if (!chrome.webRequest.onBeforeRequest.hasListener(onRequestStart)) { + chrome.webRequest.onBeforeRequest.addListener( + onRequestStart, + { + urls: [''], + types: ['main_frame' as chrome.webRequest.ResourceType], + }, + ['blocking'] + ); + } +}); diff --git a/src/ts/blocked.ts b/src/ts/blocked.ts new file mode 100644 index 0000000..e43dd6d --- /dev/null +++ b/src/ts/blocked.ts @@ -0,0 +1,213 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +/** + * Toggles visibility of the "Details" section on the blocked page. + */ +const toggleDetails = (): void => { + const details = document.getElementById('details'); + if (details) { + if (details.classList.contains('hide')) { + details.classList.remove('hide'); + } else { + details.classList.add('hide'); + } + } +}; + +/** + * Wrapper function which trusts a given domain and redirects to it after the + * change has taken effect. + * + * @param {string} domain The domain to trust. + * @param {boolean} trustSubdomains Whether to trust subdomains of the given + * domain. + * @param {number} expires The date at which the trust in the given domain + * expires. + * @param {string} requestUrl The URL to redirect to once a change in saved + * domains has been detected. + */ +const trustAndContinue = ( + domain: string, + trustSubdomains: boolean, + expires: number, + requestUrl: string +): void => { + trustDomain(domain, trustSubdomains, expires); + browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_TRUSTED_DOMAINS) > -1) { + document.location.href = requestUrl; + } + }); +}; + +/** + * Code to run when the page loads. + */ +const blocked_onLoad = (): void => { + const url = new URL(document.location.href); + const requestUrl = atob(url.searchParams.get('request_url') || ''); + const requestDomain = requestUrl ? new URL(requestUrl).hostname : ''; + const originUrl = atob(url.searchParams.get('origin_url') || ''); + const method = atob(url.searchParams.get('method') || ''); + let urlClassification = atob( + url.searchParams.get('url_classification') || '' + ); + + // Set the text conveying the blocked domain and reason + const blockedReason = document.getElementById('blocked-reason'); + if (blockedReason) { + const label = browser.i18n.getMessage('untrustedDomain'); + const domainName = document.createElement('span'); + domainName.id = 'blocked-domain-name'; + domainName.innerText = requestDomain; + blockedReason.innerHTML = `${label}: ${domainName.outerHTML}`; + } + + // Set the block explanation + const blockedExplanation = document.getElementById('blocked-explanation'); + if (blockedExplanation) { + blockedExplanation.innerText = browser.i18n.getMessage( + 'untrustedDomainDesc' + ); + } + + // Populate the blocked URL field + const blockedUrlInput = document.getElementById( + 'blocked-url' + ) as HTMLInputElement; + if (blockedUrlInput) { + if (requestUrl) { + blockedUrlInput.value = requestUrl; + } else { + blockedUrlInput.value = browser.i18n.getMessage('unknownUrl'); + } + } + + // Bind the "Copy" button + bind('copy-url', 'click', () => { + const blockedUrlInput = document.getElementById( + 'blocked-url' + ) as HTMLInputElement; + if (blockedUrlInput) { + blockedUrlInput.focus(); + blockedUrlInput.select(); + document.execCommand('copy'); + } + }); + + // Bind the "Back to safety" button + bind('to-safety', 'click', () => { + setMainImageColor(BLUE_DARK, BLUE_LIGHT); + history.back(); + }); + + // Set the default value of the "trust subdomains" checkbox + let trustSubdomainsCheckbox = document.getElementById( + 'trust-subdomains' + ) as HTMLInputElement; + if (trustSubdomainsCheckbox) { + trustSubdomainsCheckbox.checked = blocked_settings.trustSubdomainsByDefault; + } + + // Bind the "Temporarily trust and continue" button + bind('temp-trust-domain', 'click', () => { + let hostname = new URL(requestUrl).hostname; + if (blocked_settings.ignoreWww && hostname.indexOf('www.') === 0) { + hostname = hostname.replace('www.', ''); + } + let expires = + +new Date() + DEFAULT_BROWSER_GUARD_SETTINGS.tempTrustDuration * 60000; + if (blocked_settings.tempTrustDuration) { + expires = +new Date() + blocked_settings.tempTrustDuration * 60000; + } + setMainImageColor(BLUE_DARK, BLUE_LIGHT); + trustAndContinue( + hostname, + trustSubdomainsCheckbox.checked, + expires, + requestUrl + ); + }); + + // Bind the "Trust and continue" button + bind('trust-domain', 'click', () => { + let hostname = new URL(requestUrl).hostname; + if (blocked_settings.ignoreWww && hostname.indexOf('www.') === 0) { + hostname = hostname.replace('www.', ''); + } + setMainImageColor(BLUE_DARK, BLUE_LIGHT); + trustAndContinue(hostname, trustSubdomainsCheckbox.checked, 0, requestUrl); + }); + + // Bind the "Details" toggle + bind('details-toggle', 'click', () => { + toggleDetails(); + }); + + // Populate the "Request URL" detail + const detailsRequestUrl = document.getElementById('details-request-url'); + if (detailsRequestUrl) { + detailsRequestUrl.innerText = requestUrl; + } + + // Populate the "Origin URL" detail + const detailsOriginUrl = document.getElementById('details-origin-url'); + if (detailsOriginUrl) { + detailsOriginUrl.innerText = originUrl; + } + + // Populate the "Method" detail + const detailsMethod = document.getElementById('details-method'); + if (detailsMethod) { + detailsMethod.innerText = method; + } + + // Populate the "URL Classification" detail + const detailsUrlClassification = document.getElementById( + 'details-url-classification' + ); + if (detailsUrlClassification) { + if (urlClassification) { + urlClassification = JSON.parse(urlClassification); + } + let urlClassificationText: string[] = []; + Object.keys(urlClassification).forEach((party) => { + const classifications = urlClassification[party].join(', '); + urlClassificationText.push(`${party}: ${classifications}`); + }); + detailsUrlClassification.innerText = urlClassificationText.join('\n'); + } + + setMainImageColor(YELLOW_DARK, YELLOW_LIGHT, true); +}; + +let blocked_DOMContentLoaded = false; +window.addEventListener('DOMContentLoaded', () => { + blocked_DOMContentLoaded = true; +}); + +// Load settings and then call onLoad +let blocked_settings: BrowserGuardSettings; +let blocked_loadTimer: number; +getSettings((storedSettings) => { + blocked_settings = storedSettings; + blocked_loadTimer = self.setInterval(() => { + if (blocked_DOMContentLoaded) { + self.clearInterval(blocked_loadTimer); + blocked_onLoad(); + } + }, 10); +}); + +// Reload settings when they are changed +browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_SETTINGS) > -1) { + blocked_settings = JSON.parse(changes[STORAGE_SETTINGS].newValue); + } +}); diff --git a/src/ts/common.ts b/src/ts/common.ts new file mode 100644 index 0000000..1768256 --- /dev/null +++ b/src/ts/common.ts @@ -0,0 +1,544 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +/** + * + */ +const bind = (id: string, event: string, callback: (arg: any) => any): void => { + const target = document.getElementById(id); + if (target) { + target.addEventListener(event, callback); + } +} + +/** + * Returns a new ID. IDs are random, but not guaranteed to be unique. + * + * @return {string} a new ID. + */ +const newId = (): string => { + return Math.random().toString().split('.')[1]; +}; + +/** + * Checks if the current browser is Firefox based on the user agent. + * + * @return {boolean} Whether or not the current browser is Firefox. + */ +const isFirefox = (): boolean => { + return navigator.userAgent.toLowerCase().indexOf('firefox') > -1; +}; + +/** + * Removes event listeners from a DOM node by cloning it and replacing it with + * the clone. + * + * @param {HTMLElement} DOMNode The DOM node to remove event listeners from. + */ +const removeEventListeners = (DOMNode: HTMLElement): void => { + var newDOMNode = DOMNode.cloneNode(true); + DOMNode.parentNode?.replaceChild(newDOMNode, DOMNode); +}; + +/** + * Resolves the URL of an extension resource. Will use Firefox's preferred + * method if the browser is Firefox, otherwise Chrome's preferred method will be + * used. + * + * @param {string} url The URL of a file to resolve, relative to the root of the + * extension. + * @return {string} The URL of the resource. + */ +const getExtensionURL = (url: string): string => { + if (isFirefox()) { + return browser.runtime.getURL(url); + } else { + return chrome.extension.getURL(url); + } +}; + +/** + * Returns a copy of a given string with all regex-sensitive characters replaced + * for use in regular expressions. See: https://stackoverflow.com/a/9310752 + * + * @param {string} string The string to escape. + * @return {string} The string with regex characters escaped. + */ +const escapeRegExp = (string: string): string => { + return string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +}; + +/** + * Triggers the download of a string as a file. + * + * @param {string} string The string to download as a file. + * @param {string} contentType The content type of the file to download, e.g. + * "application/json". + * @param {string} fileName The name to give the downloaded file. + */ +const downloadString = ( + string: string, + contentType: string, + fileName: string +): void => { + const downloadLink = document.createElement('a'); + downloadLink.setAttribute( + 'href', + `data:${contentType};charset=utf-8,${encodeURIComponent(string)}` + ); + downloadLink.setAttribute('download', fileName); + downloadLink.style.display = 'none'; + document.body.appendChild(downloadLink); + downloadLink.click(); + document.body.removeChild(downloadLink); +}; + +/** + * Reads the contents of a file selected through a file input into a string and + * passes it to a callback. + * + * @param {HTMLInputElement} input The file input to read. + * @param {function} callback The function to pass the file contents to (if + * any). + */ +const readFileInput = ( + input: HTMLInputElement, + callback: (string: string) => any +): void => { + if (input && input.files && input.files[0]) { + const selectedFile = input.files[0]; + const reader = new FileReader(); + reader.addEventListener('load', (event) => { + let contents = ''; + if (event.target && event.target.result) { + contents = event.target.result.toString(); + } + callback(contents); + }); + reader.readAsBinaryString(selectedFile); + } +}; + +/** + * Returns the approximate number of minutes between a given date as a number + * and now. + * + * @param {number} time The date expressed as the number of milliseconds since + * 1 January 1970 UTC. + * @return {number} The difference in minutes between the given time and now. + */ +const getTimeInMinutes = (time: number): number => { + const now = +new Date(); + if (time) { + if (time > now) { + return Math.round((time - now) / 1000 / 60); + } else { + return Math.round(((time - now) * -1) / 1000 / 60) * -1; + } + } + return 0; +}; + +/** + * Returns the approximate number of minutes between a given date as a number + * and now, followed by 'minute' or 'minutes' (whichever is most appropriate.) + * + * @param {number} time The date expressed as the number of milliseconds since + * 1 January 1970 UTC. + * @return {string} The difference in minutes between the given time and now, + * followed by 'minute' or 'minutes' (whichever is most appropriate.) + */ +const getTimeInMinutesFormatted = (time: number): string => { + const minutes = getTimeInMinutes(time); + if (minutes || minutes === 0) { + const minutesText = + minutes === 1 + ? browser.i18n.getMessage('minute') + : browser.i18n.getMessage('minutes'); + return `${minutes} ${minutesText}`; + } + return ''; +}; + +/** + * Changes the color of the main Browser Guard badge, if present as an SVG. + * + * @param {string} leftColor The color to set for the left half of the badge. + * Can be any valid CSS color. + * @param {string} rightColor The color to set for the right half of the badge. + * Can be any valid CSS color. + */ +const setMainImageColor = ( + leftColor: string, + rightColor: string, + fade = false +): void => { + const leftHalf = document.getElementById('main-image-left'); + const rightHalf = document.getElementById('main-image-right'); + if (leftHalf && rightHalf) { + if (fade) { + leftHalf.classList.add('fill-fade'); + rightHalf.classList.add('fill-fade'); + } else { + leftHalf.classList.remove('fill-fade'); + rightHalf.classList.remove('fill-fade'); + } + leftHalf.setAttribute('fill', leftColor); + rightHalf.setAttribute('fill', rightColor); + } +}; + +/** + * Add or remove padding depending on the presence of vertical scrollbars. This + * works around the bug discusses here: + * https://bugzilla.mozilla.org/show_bug.cgi?id=1400279 + * where vertical scrollbars in the popup take up 17 pixels, requiring the body + * to side-scroll. + */ +const fixPopupHorizontalScroll = (): void => { + const content = document.getElementById('content'); + if (content) { + const layoutPadding = () => { + if (document.documentElement.scrollHeight > window.innerHeight) { + content.classList.add('pad'); + } else { + content.classList.remove('pad'); + } + }; + layoutPadding(); + window.addEventListener('resize', () => { + layoutPadding(); + }); + } +}; + +/** + * Checks whether or not a given domain is found in a given array of trusted + * domains. + * + * @param {string} testDomain The domain to search for in the array of trusted + * domains. + * @param {TrustedDomain[]} trustedDomains An array of TrustedDomain objects to + * check. + * @param {boolean} ignoreWww Whether to remove "www." from testDomain before + * testing its trust. + */ +const isTrustedDomain = ( + testDomain: string, + trustedDomains: TrustedDomain[], + ignoreWww: boolean = false +): boolean => { + const trustedDomain = getTrustedDomain(testDomain, trustedDomains, ignoreWww); + if (trustedDomain) { + return true; + } + return false; +}; + +/** + * Checks whether or not a given domain is found in a given array of trusted + * domains and returns its TrustedDomain object. Returns false if it is not + * found. + * + * @param {string} testDomain The domain to search for in the array of trusted + * domains. + * @param {TrustedDomain[]} trustedDomains An array of TrustedDomain objects to + * check. + * @param {boolean} ignoreWww Whether to remove "www." from testDomain before + * testing its trust. + */ +const getTrustedDomain = ( + testDomain: string, + trustedDomains: TrustedDomain[], + ignoreWww: boolean = false +): TrustedDomain | boolean => { + // Don't trust empty domains + if (!testDomain) { + return false; + } + + // Remove any trailing "." characters form the domain name to prevent domains + // like "example.com.attacker.com." (note the trailing ".") from being + // interpreted as an "example.com" subdomain later on + testDomain = testDomain.replace(/\.*$/g, ''); + + if (ignoreWww && testDomain.indexOf('www.') === 0) { + testDomain = testDomain.replace('www.', ''); + } + + let matchedTrustedDomain = {} as TrustedDomain; + const trustFound = trustedDomains.some((trustedDomain) => { + if (trustedDomain.expires === 0 || trustedDomain.expires > +new Date()) { + // Trust the domain if it is an exact match for a domain in the trust + // list + if (trustedDomain.domain === testDomain) { + matchedTrustedDomain = trustedDomain; + return true; + } + + // Trust the domain if it is a subdomain of a domain in the trust list + // and that domain is set to trust subdomains. + // + // Here we assume that the domain we're testing looks like + // "foo.example.com" and the trusted domain is "example.com". If we + // replace "example.com" with nothing, we're left with "foo.", with "." + // as the final character, meaning this is a subdomain of "example.com". + // + // However, if we're testing a domain like "fooexample.com" or + // "example.com.attacker.com", we will instead be left with "foo" or + // "attacker.com" respectively, and will not consider these to be + // subdomains of "example.com". + const domainMatch = new RegExp(escapeRegExp(trustedDomain.domain), 'g'); + const sub = testDomain.replace(domainMatch, ''); + if (sub.slice(-1) === '.' && trustedDomain.trustSubdomains === true) { + matchedTrustedDomain = trustedDomain; + return true; + } + } + }); + if (trustFound) { + return matchedTrustedDomain; + } else { + return false; + } +}; + +/** + * Retrieve the list of trusted domains from localStorage and send them to a + * callback function. Results are an array of TrustedDomain objects. + * + * @param {function} callback A function to call with the array of trusted + * domains. + * @param {boolean=} filterExpired Whether or not to remove expired domains from + * from the array before sending it to the callback. Default: true. + */ +const getTrustedDomains = ( + callback: (trustedDomains: TrustedDomain[]) => void, + filterExpired = true +): void => { + browser.storage.local + .get(STORAGE_TRUSTED_DOMAINS) + .then((savedTrustedDomains) => { + let trustedDomains: TrustedDomain[] = []; + if ( + typeof savedTrustedDomains[STORAGE_TRUSTED_DOMAINS] !== 'undefined' && + savedTrustedDomains[STORAGE_TRUSTED_DOMAINS].length > 0 + ) { + try { + trustedDomains = JSON.parse( + savedTrustedDomains[STORAGE_TRUSTED_DOMAINS] + ); + if (filterExpired) { + trustedDomains = removeExpiredTrustedDomains(trustedDomains); + } + } catch (e) {} + } + callback(trustedDomains); + }); +}; + +/** + * Set the list of trusted domains in localStorage to a given array of + * TrustedDomain objects. + * + * @param {TrustedDomain[]} trustedDomains An array of TrustedDomain objects. + */ +const setTrustedDomains = (trustedDomains: TrustedDomain[]): void => { + const storeSetting = {}; + storeSetting[STORAGE_TRUSTED_DOMAINS] = JSON.stringify(trustedDomains); + browser.storage.local.set(storeSetting); +}; + +/** + * Set the value of the domain field for the trusted domain with the given ID. + * + * @param {string} trustedDomainId The ID of the trusted domain to change. + * @param {boolean} domain The new value of the domain field. + */ +const setTrustedDomain = (trustedDomainId: string, domain: string): void => { + getTrustedDomains((trustedDomains) => { + trustedDomains.some((trustedDomain, i) => { + if (trustedDomain.id === trustedDomainId) { + trustedDomains[i].domain = domain; + setTrustedDomains(trustedDomains); + return true; + } + }); + }); +}; + +/** + * Set the value of the trustSubdomains field for the trusted domain with the + * given ID. + * + * @param {string} trustedDomainId The ID of the trusted domain to change. + * @param {boolean} trustSubdomains The new value of the trustSubdomains field. + */ +const setTrustSubdomains = ( + trustedDomainId: string, + trustSubdomains: boolean +): void => { + getTrustedDomains((trustedDomains) => { + trustedDomains.some((trustedDomain, i) => { + if (trustedDomain.id === trustedDomainId) { + trustedDomains[i].trustSubdomains = trustSubdomains; + setTrustedDomains(trustedDomains); + return true; + } + }); + }); +}; + +/** + * Returns the 'expires' value for a trusted domain rule matching the specified + * "loadedDomain" and "trustedDomains" values, if any. + * + * @param {string} loadedDomain The domain to search for in the array of trusted + * domains. + * @param {TrustedDomain[]} loadedDomain An array of TrustedDomain objects to + * check. * + * @param {boolean} ignoreWww Whether to remove "www." from testDomain before + * testing its trust. + */ +const getTrustExpires = ( + loadedDomain: string, + trustedDomains: TrustedDomain[], + ignoreWww: boolean = false +): number | boolean => { + const trustedDomain = getTrustedDomain( + loadedDomain, + trustedDomains, + ignoreWww + ); + if (trustedDomain && typeof trustedDomain !== 'boolean') { + return trustedDomain.expires; + } + return false; +}; + +/** + * Set the value of the expires field for the trusted domain with the given ID. + * + * @param {string} trustedDomainId The ID of the trusted domain to change. + * @param {boolean} expires The new value of the expires field. + */ +const setTrustExpires = (trustedDomainId: string, expires: number): void => { + getTrustedDomains((trustedDomains) => { + trustedDomains.some((trustedDomain, i) => { + if (trustedDomain.id === trustedDomainId) { + trustedDomains[i].expires = expires; + setTrustedDomains(trustedDomains); + return true; + } + }); + }); +}; + +/** + * Add a domain to the trust list in localStorage. + * + * @param {string} domain The domain name to trust, with or without subdomains. + * @param {boolean} trustSubdomains Whether or not to trust subdomains of the + * specified domain. + * @param {number} expires A date as a number specifying when this domain should + * be removed from the trust list. + */ +const trustDomain = ( + domain: string, + trustSubdomains: boolean, + expires: number +): void => { + getTrustedDomains((trustedDomains) => { + // Just update the Expires value if there is already a trust entry for + // this domain with the same trustSubdomains value + const domainAlreadyTrusted = trustedDomains.some((trustedDomain, i) => { + if ( + trustedDomain.domain === domain && + trustedDomain.trustSubdomains === trustSubdomains + ) { + trustedDomains[i].expires = expires; + return true; + } + }); + // Otherwise, create a new trust entry for this domain + if (!domainAlreadyTrusted) { + const id = newId(); + const newDomain: TrustedDomain = {id, domain, trustSubdomains, expires}; + trustedDomains.push(newDomain); + } + setTrustedDomains(trustedDomains); + }); +}; + +/** + * Removes a given trusted domain from the list of trusted domains. + * + * @param {string} trustedDomainId The ID of the trusted domain to untrust. + */ +const untrustDomain = (trustedDomainId: string): void => { + getTrustedDomains((trustedDomains) => { + trustedDomains.some((trustedDomain, i) => { + if (trustedDomain.id === trustedDomainId) { + trustedDomains.splice(i, 1); + setTrustedDomains(trustedDomains); + return true; + } + }); + }); +}; + +/** + * Removes expired domains from a given array of TrustedDomain objects. + * + * @param {TrustedDomain[]} trustedDomains An array of TrustedDomain objects to + * remove expired trusted domains from. + * @return {TrustedDomain[]} An array of trusted domains which aren't expired. + */ +const removeExpiredTrustedDomains = ( + trustedDomains: TrustedDomain[] +): TrustedDomain[] => { + return trustedDomains.filter((trustedDomain) => { + return trustedDomain.expires === 0 || trustedDomain.expires > +new Date(); + }); +}; + +/** + * Retrieves the saved settings object from local storage and passes it to + * callback. Passes an object with default settings if there are no saved + * settings. This function merges default settings and saved settings before + * returning them, so new setting values can be added to the application without + * breaking existing user's settings. + * + * @param {function} callback The function to call with the settings object. + */ +const getSettings = ( + callback: (settings: BrowserGuardSettings) => void +): void => { + browser.storage.local.get(STORAGE_SETTINGS).then((savedSettings) => { + let settings: BrowserGuardSettings = DEFAULT_BROWSER_GUARD_SETTINGS; + if ( + typeof savedSettings[STORAGE_SETTINGS] !== 'undefined' && + savedSettings[STORAGE_SETTINGS].length > 0 + ) { + try { + const parsedSettings = JSON.parse(savedSettings[STORAGE_SETTINGS]); + settings = {...DEFAULT_BROWSER_GUARD_SETTINGS, ...parsedSettings}; + } catch (e) {} + } + callback(settings); + }); +}; + +/** + * Saves the given settings object to local storage. + * + * @param {BrowserGuardSettings} settings The settings object to save. + */ +const setSettings = (settings: BrowserGuardSettings): void => { + const storeSetting = {}; + storeSetting[STORAGE_SETTINGS] = JSON.stringify(settings); + browser.storage.local.set(storeSetting); +}; diff --git a/src/ts/config.ts b/src/ts/config.ts new file mode 100644 index 0000000..7527af7 --- /dev/null +++ b/src/ts/config.ts @@ -0,0 +1,39 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +// Key used to store and access trusted domains in local storage +const STORAGE_TRUSTED_DOMAINS = 'trustedDomains'; + +// Key used to store and access settings in local storage +const STORAGE_SETTINGS = 'settings'; + +const DEFAULT_BROWSER_GUARD_SETTINGS = { + // Whether to remove "www." from domains before trusting them and to ignore + // the "www" subdomain such that trusting "example.com" also trusts + // "www.example.com" + ignoreWww: true, + + // Whether to trust subdomains by default + trustSubdomainsByDefault: true, + + // Duration to temporarily trust domains (in minutes) + tempTrustDuration: 60, + + // Whether to set the "Expires" field to the tempTrustDefaultDuration value by + // default on the "Add trust" form in settings (else it is set to "Never" by + // default) + tempTrustByDefault: false, +} + +// Colors +const BLUE_DARK = '#009fd6'; +const BLUE_LIGHT = '#14b7f1'; +const YELLOW_DARK = '#f0c133'; +const YELLOW_LIGHT = '#f7d777'; +const RED_DARK = '#a82121'; +const RED_LIGHT = '#c64f4f'; +const GRAY_DARK = '#d5d5d5'; +const GRAY_LIGHT = '#eaeaea'; diff --git a/src/ts/l10n.ts b/src/ts/l10n.ts new file mode 100644 index 0000000..406f1cf --- /dev/null +++ b/src/ts/l10n.ts @@ -0,0 +1,61 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: piroor + * Author: Jonathan Gregson + * License: GPL v3 + * + * This file was originally released under the MIT license. However, it has been + * modified for Browser Guard and re-released under the GPL v3 license. + * Source: + * http://github.com/piroor/webextensions-lib-l10n + */ + +const l10n = { + updateString(string: string): string { + return string.replace(/__MSG_([@\w]+)__/g, (matched, key) => { + return chrome.i18n.getMessage(key) || matched; + }); + }, + + updateSubtree(node: Node): void { + const texts = document.evaluate( + 'descendant::text()[contains(self::text(), "__MSG_")]', + node, + null, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, + null + ); + for (let i = 0, maxi = texts.snapshotLength; i < maxi; i++) { + const text = texts.snapshotItem(i); + if (text) { + text.nodeValue = this.updateString(text.nodeValue); + } + } + + const attributes = document.evaluate( + 'descendant::*/attribute::*[contains(., "__MSG_")]', + node, + null, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, + null + ); + for (let i = 0, maxi = attributes.snapshotLength; i < maxi; i++) { + const attribute = attributes.snapshotItem(i) as SubtreeAttribute; + if (attribute && attribute.value) { + attribute.value = this.updateString(attribute.value); + } + } + }, + + updateDocument() { + this.updateSubtree(document); + }, +}; + +document.addEventListener( + 'DOMContentLoaded', + () => { + l10n.updateDocument(); + }, + {once: true} +); diff --git a/src/ts/popup.ts b/src/ts/popup.ts new file mode 100644 index 0000000..bcddd3f --- /dev/null +++ b/src/ts/popup.ts @@ -0,0 +1,259 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +/** + * Retrieves the currently selected tab and passes it to a callback function. + * Passes an empty string to an error handler callback if the active tab could + * not be retrieved. + * + * @param {function} callback The function to pass the current tab to. + * @param {function} errorCallback The function to call if the current tab + * cannot be retrieved. + */ +const getCurrentTab = ( + callback: (tab: browser.tabs.Tab) => void, + errorCallback: (string: string) => void +): void => { + browser.tabs.query({currentWindow: true, active: true}).then((tabs) => { + let tab = tabs.length > 0 ? tabs[0] : null; + if (tab && tab.url) { + callback(tab); + } else { + errorCallback(''); + } + }, errorCallback); +}; + +/** + * Update the UI to show the current trust and trusted domain rule (if any) for + * the domain loaded in the currently selected tab. + * + * @param {TrustedDomain[]} trustedDomains The list of trusted domain objects to + * check the loaded domain against. + * @param {BrowserGuardSettings} settings A BrowserGuardSettings object. + */ +const displayDomainTrust = ( + trustedDomains: TrustedDomain[], + settings: BrowserGuardSettings +): void => { + getCurrentTab((tab) => { + const loadedUrl = new URL(tab.url ? tab.url : ''); + const loadedDomain = loadedUrl.hostname; + const browserProtocols = ['about:', 'chrome:', 'edge:']; + const extensionProtocols = [ + 'moz-extension:', + 'chrome-extension:', + 'extension:', + ]; + const domainTrustRuleLabel = document.getElementById( + 'domain-trust-rule-label' + ); + const domainTrustRuleDomain = document.getElementById( + 'domain-trust-rule-domain' + ); + const domainTrustRuleSubdomains = document.getElementById( + 'domain-trust-rule-trust-subdomains' + ); + const domainTrustRuleExpired = document.getElementById( + 'domain-trust-rule-expired' + ); + const trustSubdomainsWrap = document.getElementById( + 'trust-subdomains-wrap' + ); + const toSafetyButton = document.getElementById('to-safety-button'); + const tempTrustButton = document.getElementById('temp-trust-button'); + const trustDomainButton = document.getElementById('trust-domain-button'); + let removeTrustButton = document.getElementById('remove-trust-button'); + const domainTrustLabel = document.getElementById('domain-trust-label'); + const domainExpiresLabel = document.getElementById('domain-expires-label'); + if (domainTrustLabel && domainExpiresLabel) { + domainTrustLabel.innerText = ''; + domainExpiresLabel.innerText = ''; + } else { + return; + } + + // Hide all buttons and controls initially + toSafetyButton?.classList.add('hide'); + tempTrustButton?.classList.add('hide'); + trustDomainButton?.classList.add('hide'); + removeTrustButton?.classList.add('hide'); + trustSubdomainsWrap?.classList.add('hide'); + + if (isTrustedDomain(loadedDomain, trustedDomains, settings.ignoreWww)) { + removeTrustButton?.classList.remove('hide'); + domainTrustRuleLabel?.classList.remove('hide'); + setMainImageColor(BLUE_DARK, BLUE_LIGHT, true); + const trustedDomain = getTrustedDomain( + loadedDomain, + trustedDomains, + settings.ignoreWww + ); + + // Bind the "Remove trust" button + if (removeTrustButton) { + if (trustedDomain && typeof trustedDomain !== 'boolean') { + removeEventListeners(removeTrustButton); + removeTrustButton = document.getElementById('remove-trust-domain'); + removeTrustButton?.addEventListener('click', () => { + untrustDomain(trustedDomain.id); + }); + } + } + + // Populate the matching trust rule table + if (trustedDomain && typeof trustedDomain !== 'boolean') { + if ( + domainTrustRuleDomain && + domainTrustRuleSubdomains && + domainTrustRuleExpired + ) { + domainTrustRuleDomain.innerText = trustedDomain.domain; + domainTrustRuleSubdomains.innerText = trustedDomain.trustSubdomains + ? 'yes' + : 'no'; + domainTrustRuleExpired.innerText = trustedDomain.expires + ? getTimeInMinutesFormatted(+new Date(trustedDomain.expires)) + : 'never'; + } + } + + const expires = getTrustExpires( + loadedDomain, + trustedDomains, + settings.ignoreWww + ); + if (expires && typeof expires !== 'boolean') { + trustDomainButton?.classList.remove('hide'); + domainTrustLabel.innerText = + browser.i18n.getMessage('domainTempTrusted'); + domainExpiresLabel.innerText = [ + browser.i18n.getMessage('trustExpiresIn'), + getTimeInMinutesFormatted(expires), + ].join(' '); + } else { + domainTrustLabel.innerText = browser.i18n.getMessage('domainIsTrusted'); + } + } else if (browserProtocols.indexOf(loadedUrl.protocol) > -1) { + setMainImageColor(BLUE_DARK, BLUE_LIGHT, true); + domainTrustLabel.innerText = browser.i18n.getMessage('domainIsBrowser'); + domainTrustRuleLabel?.classList.add('hide'); + } else if (extensionProtocols.indexOf(loadedUrl.protocol) > -1) { + setMainImageColor(BLUE_DARK, BLUE_LIGHT, true); + domainTrustLabel.innerText = browser.i18n.getMessage('domainIsExtension'); + domainTrustRuleLabel?.classList.add('hide'); + } else { + toSafetyButton?.classList.remove('hide'); + tempTrustButton?.classList.remove('hide'); + trustDomainButton?.classList.remove('hide'); + trustSubdomainsWrap?.classList.remove('hide'); + setMainImageColor(YELLOW_DARK, YELLOW_LIGHT, true); + domainTrustLabel.innerText = browser.i18n.getMessage('domainNotTrusted'); + domainTrustRuleLabel?.classList.add('hide'); + } + }, console.error); +}; + +/** + * Bind the controls and buttons on the popup. + */ +const bindControls = (): void => { + // Set the default value of the "trust subdomains" checkbox + const trustSubdomainsCheckbox = document.getElementById( + 'trust-subdomains' + ) as HTMLInputElement; + if (trustSubdomainsCheckbox) { + trustSubdomainsCheckbox.checked = popup_settings.trustSubdomainsByDefault; + } + + // Bind "To safety" button + bind('to-safety', 'click', () => { + getCurrentTab((tab) => { + if (tab.id) { + browser.tabs.reload(tab.id); + } + }, console.error); + }); + + // Bind "Trust temporarily" button + bind('temp-trust-domain', 'click', () => { + getCurrentTab((tab) => { + let requestedDomain = new URL(tab.url ? tab.url : '').hostname; + if (popup_settings.ignoreWww) { + requestedDomain = requestedDomain.replace('www.', ''); + } + let trustSubdomains = popup_settings.trustSubdomainsByDefault; + if (trustSubdomainsCheckbox) { + trustSubdomains = trustSubdomainsCheckbox.checked; + } + let expires = +new Date() + popup_settings.tempTrustDuration * 60000; + trustDomain(requestedDomain, trustSubdomains, expires); + }, console.error); + }); + + // Bind "Trust permanently" button + bind('trust-domain', 'click', () => { + getCurrentTab((tab) => { + let requestedDomain = new URL(tab.url ? tab.url : '').hostname; + if (popup_settings.ignoreWww) { + requestedDomain = requestedDomain.replace('www.', ''); + } + let trustSubdomains = popup_settings.trustSubdomainsByDefault; + if (trustSubdomainsCheckbox) { + trustSubdomains = trustSubdomainsCheckbox.checked; + } + trustDomain(requestedDomain, trustSubdomains, 0); + }, console.error); + }); +}; + +/** + * Code to run when the page loads. + */ +const popup_onLoad = (): void => { + // Load the domain trust status + getTrustedDomains((trustedDomains) => { + displayDomainTrust(trustedDomains, popup_settings); + }); + + // Reload domain trust status if it changes in storage + browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_TRUSTED_DOMAINS) > -1) { + trustedDomains = JSON.parse(changes[STORAGE_TRUSTED_DOMAINS].newValue); + displayDomainTrust(trustedDomains, popup_settings); + } + }); + + bindControls(); + fixPopupHorizontalScroll(); +}; + +let popup_DOMContentLoaded = false; +window.addEventListener('DOMContentLoaded', () => { + popup_DOMContentLoaded = true; +}); + +// Load settings and then call onLoad +let popup_settings: BrowserGuardSettings; +let popup_loadTimer: number; +getSettings((storedSettings) => { + popup_settings = storedSettings; + popup_loadTimer = self.setInterval(() => { + if (popup_DOMContentLoaded) { + self.clearInterval(popup_loadTimer); + popup_onLoad(); + } + }, 10); +}); + +// Reload settings when they are changed +browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_SETTINGS) > -1) { + popup_settings = JSON.parse(changes[STORAGE_SETTINGS].newValue); + } +}); diff --git a/src/ts/settings.ts b/src/ts/settings.ts new file mode 100644 index 0000000..4d1b6de --- /dev/null +++ b/src/ts/settings.ts @@ -0,0 +1,334 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +/** + * Imports trusted domains from a JSON-encoded string. + * + * @param {string} string The string to import. Should be an array of + * TrustedDomain objects as valid JSON. + */ +const importDomains = (string: string): void => { + if (string && string.length > 10) { + try { + const domainsToImport = JSON.parse(string); + getTrustedDomains((trustedDomains) => { + domainsToImport.forEach((domainToImport: TrustedDomain) => { + if ( + typeof domainToImport.id === 'string' && + typeof domainToImport.domain === 'string' && + typeof domainToImport.trustSubdomains === 'boolean' && + typeof domainToImport.expires === 'number' + ) { + trustedDomains.push({ + id: newId(), + domain: domainToImport.domain, + trustSubdomains: domainToImport.trustSubdomains, + expires: domainToImport.expires, + } as TrustedDomain); + } + }); + setTrustedDomains(trustedDomains); + }); + } catch (e) {} + } +}; + +/** + * Returns a trusted domain list row with all of the buttons and controls bound. + * + * @param {TrustedDomain} trustedDomain The trusted domain object to create a + * list row for. + * @return {HTMLDivElement} The new list row with all of the buttons and + * controls bound. + */ +const getTrustedDomainListRow = ( + trustedDomain: TrustedDomain +): HTMLDivElement => { + const listRow = document.createElement('div'); + listRow.classList.add('trusted-domain-list-row'); + listRow.classList.add('trusted-domain-entry'); + + // Create the "Domain" field + const domainField = document.createElement('div'); + domainField.classList.add('trusted-domain-list-row-domain'); + const domainInput = document.createElement('input'); + domainInput.type = 'text'; + domainInput.classList.add('trusted-domain-list-domain-input'); + domainInput.value = trustedDomain.domain; + domainInput.dataset.originalValue = trustedDomain.domain; + domainInput.addEventListener('change', (event) => { + if (event.target) { + const target = event.target as HTMLInputElement; + if (target.dataset.originalValue) { + if (target.value !== target.dataset.originalValue) { + setTrustedDomain(trustedDomain.id, target.value); + } + } + } + }); + domainField.appendChild(domainInput); + listRow.appendChild(domainField); + + // Create the "Trust Subdomains" field + const subdomainField = document.createElement('div'); + subdomainField.classList.add('trusted-domain-list-row-subdomain'); + const subdomainCheckbox = document.createElement('input'); + subdomainCheckbox.type = 'checkbox'; + subdomainCheckbox.checked = trustedDomain.trustSubdomains; + subdomainCheckbox.addEventListener('change', (event) => { + if (event.target) { + setTrustSubdomains( + trustedDomain.id, + (event.target as HTMLInputElement).checked + ); + } + }); + subdomainField.appendChild(subdomainCheckbox); + listRow.appendChild(subdomainField); + + // Create the "Expires" field + const expiresField = document.createElement('div'); + expiresField.classList.add('trusted-domain-list-row-expires'); + const expiresText = document.createElement('div'); + expiresText.classList.add('trusted-domain-list-row-expires-text'); + if (trustedDomain.expires === 0) { + expiresText.innerText = browser.i18n.getMessage('never'); + } else { + expiresText.innerText = getTimeInMinutesFormatted(trustedDomain.expires); + expiresText.title = new Date(trustedDomain.expires).toString(); + } + expiresField.appendChild(expiresText); + listRow.appendChild(expiresField); + + // Create the "Options" field + const removeTrustField = document.createElement('div'); + removeTrustField.classList.add('trusted-domain-list-row-options'); + const removeTrustButton = document.createElement('button'); + removeTrustButton.innerText = browser.i18n.getMessage('removeTrust'); + removeTrustButton.addEventListener('click', (event) => { + untrustDomain(trustedDomain.id); + }); + removeTrustField.appendChild(removeTrustButton); + listRow.appendChild(removeTrustField); + + return listRow; +}; + +/** + * Returns a form used to create a new trusted domain list row with all of the + * buttons and controls bound. + * + * @return {HTMLDivElement} The new form as a list row with all of the buttons + * and controls bound. + */ +const bindAddTrustedDomainForm = (): void => { + getSettings((settings) => { + // Bind the "Trust Subdomains" checkbox + const subdomainCheckbox = document.getElementById( + 'new-trust-subdomain-input' + ) as HTMLInputElement; + if (subdomainCheckbox) { + subdomainCheckbox.checked = settings.trustSubdomainsByDefault; + } + + // Bind the "Expires" field + if (settings.tempTrustByDefault) { + const expiresSelect = document.getElementById( + 'new-expires-input' + ) as HTMLInputElement; + if (expiresSelect && settings.tempTrustDuration !== 0) { + expiresSelect.value = settings.tempTrustDuration.toString(); + } + } + + // Bind the "Add trust" button + bind('add-trust-button', 'click', () => { + const newDomain = document.getElementById( + 'new-trusted-domain-input' + ) as HTMLInputElement; + const newSubdomains = document.getElementById( + 'new-trust-subdomain-input' + ) as HTMLInputElement; + const newExpires = document.getElementById( + 'new-expires-input' + ) as HTMLInputElement; + if (newDomain && newDomain.value && newSubdomains && newExpires) { + let expires = parseInt(newExpires.value); + if (expires !== 0) { + expires = +new Date() + expires * 60000; + } + trustDomain(newDomain.value, newSubdomains.checked, expires); + } + }); + }); +}; + +/** + * Binds settings to the settings form items. + */ +const bindSettingsForm = (): void => { + getSettings((settings) => { + const settingsKeys = Object.keys(settings); + const settingsToBind = document.querySelectorAll( + '[data-bind-setting]' + ) as NodeListOf; + settingsToBind.forEach((settingToBind) => { + if (settingToBind.dataset.bindSetting) { + const boundSetting = settingToBind.dataset.bindSetting; + if (settingsKeys.indexOf(boundSetting) > -1) { + if (settingToBind.type === 'checkbox') { + settingToBind.checked = settings[boundSetting]; + settingToBind.addEventListener('change', (event) => { + getSettings((settings) => { + settings[boundSetting] = settingToBind.checked; + setSettings(settings); + }); + }); + } else { + settingToBind.value = settings[boundSetting]; + settingToBind.addEventListener('change', () => { + getSettings((settings) => { + settings[boundSetting] = settingToBind.value; + setSettings(settings); + }); + }); + } + } else { + console.warn(`Cannot bind setting, ${boundSetting} is not defined.`); + } + } + }); + }); +}; + +/** + * Populates the given div with the given list of TrustedDomain objects. + * + * @param {TrustedDomain[]} trustedDomains The trusted domain objects to add to + * the DOM. + * @param {HTMLDivElement} target The div to add the trusted domain list to. + */ +const loadTrustedDomainsList = ( + trustedDomains: TrustedDomain[], + target: HTMLDivElement +): void => { + trustedDomains.forEach((trustedDomain) => { + target.appendChild(getTrustedDomainListRow(trustedDomain)); + }); +}; + +window.addEventListener('load', () => { + // Bind tabs + const tabs = document.querySelectorAll('.tab'); + const sections = document.querySelectorAll('.section'); + tabs.forEach((tab) => { + tab.addEventListener('click', (event) => { + [...tabs, ...sections].forEach((unselect) => { + unselect.classList.remove('selected'); + }); + tab.classList.add('selected'); + const boundSection = (tab as HTMLElement).dataset.bind; + if (boundSection && document.getElementById(boundSection)) { + document.getElementById(boundSection)?.classList.add('selected'); + } + }); + }); + + bindAddTrustedDomainForm(); + bindSettingsForm(); + + // Reload elements when settings change + browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_SETTINGS) > -1) { + bindAddTrustedDomainForm(); + bindSettingsForm(); + } + }); + + const trustedDomainsList = document.getElementById( + 'trusted-domains-list' + ) as HTMLDivElement; + if (trustedDomainsList) { + // Load the trusted domains list + getTrustedDomains((trustedDomains) => { + loadTrustedDomainsList(trustedDomains, trustedDomainsList); + }); + + // Reload trusted domains list if it changes in storage + browser.storage.onChanged.addListener((changes, areaName) => { + const keys = Object.keys(changes); + if (areaName === 'local' && keys.indexOf(STORAGE_TRUSTED_DOMAINS) > -1) { + trustedDomains = JSON.parse(changes[STORAGE_TRUSTED_DOMAINS].newValue); + const trustedDomainEntries = trustedDomainsList.querySelectorAll( + '.trusted-domain-entry' + ); + trustedDomainEntries.forEach((entry) => { + entry.parentElement?.removeChild(entry); + }); + loadTrustedDomainsList(trustedDomains, trustedDomainsList); + } + }); + } + + // Load the extension version on the about page + const versionOutput = document.getElementById('about-version'); + if (versionOutput) { + versionOutput.innerText = browser.runtime.getManifest().version; + } + + // Change behavior if settings is opened inside the popup + if (new URL(document.location.href).searchParams.get('popup') === 'true') { + const settingsIcon = document.getElementById('heading-settings-wrap'); + if (settingsIcon) { + settingsIcon.classList.remove('hide'); + } + fixPopupHorizontalScroll(); + self.setTimeout(() => { + fixPopupHorizontalScroll(); + }, 100); + document.body.classList.add('popup'); + } + + // Bind the "Import trusted domains" button + bind('import-domains-button', 'click', () => { + const importDomainsFile = document.getElementById( + 'import-domains-file' + ) as HTMLInputElement; + if (importDomainsFile && importDomainsFile.files) { + readFileInput(importDomainsFile, (contents) => { + importDomains(contents); + }); + } + }); + + // Bind the "Export trusted domains" button + bind('export-domains-button', 'click', () => { + getTrustedDomains((trustedDomains) => { + if (trustedDomains && Object.keys(trustedDomains).length > 0) { + downloadString( + JSON.stringify(trustedDomains), + 'application/json', + 'browser-guard-trusted-domains.json' + ); + } else { + alert(browser.i18n.getMessage('noTrustedDomainsFound')); + } + }); + }); + + // Bind the "Reset trusted domains" button + bind('reset-trusted-domains-button', 'click', () => { + const setting = {}; + setting[STORAGE_TRUSTED_DOMAINS] = {}; + browser.storage.local.set(setting); + }); + + // Bind the "Reset settings" button + bind('reset-settings-button', 'click', () => { + browser.storage.local.remove(STORAGE_SETTINGS); + }); +}); diff --git a/src/ts/types.ts b/src/ts/types.ts new file mode 100644 index 0000000..4772678 --- /dev/null +++ b/src/ts/types.ts @@ -0,0 +1,34 @@ +/** + * This file is part of Browser Guard, a browser extension for the paranoid. + * Author: Jonathan Gregson + * License: GPL v3 + */ + +interface TrustedDomain { + id: string; + domain: string; + trustSubdomains: boolean; + expires: number; +} + +interface BrowserGuardSettings { + ignoreWww: boolean; + trustSubdomainsByDefault: boolean; + tempTrustDuration: number; + tempTrustByDefault: boolean; +} + +interface URLClassification { + firstParty?: string[]; + thirdParty?: string[]; +} + +interface FullWebRequestBodyDetails + extends chrome.webRequest.WebRequestBodyDetails { + urlClassification: URLClassification; + originUrl: string; +} + +interface SubtreeAttribute extends Node { + value: any; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..79a9098 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "strictNullChecks": true, + "typeRoots": ["node_modules/@types"], + "types": ["chrome", "firefox-webext-browser"] + } +} diff --git a/workspace.code-workspace b/workspace.code-workspace new file mode 100644 index 0000000..022c3e5 --- /dev/null +++ b/workspace.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +}