From d49772833d5c2148fc392cb3ee5b25698ef78a73 Mon Sep 17 00:00:00 2001 From: alct Date: Tue, 18 Aug 2015 19:09:04 +0200 Subject: [PATCH] Initial commit --- .gitignore | 3 + CREDITS | 22 ++ LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++ README.md | 54 ++++ bin/bookmarklet_fr.js | 1 + bin/bookmarklet_nl.js | 1 + lib/.placeholder | 0 scripts/build | 57 ++++ scripts/install | 69 +++++ src/main.css | 458 ++++++++++++++++++++++++++++ src/main.js | 349 ++++++++++++++++++++++ src/translations.json | 30 ++ src/utility.js | 137 +++++++++ 13 files changed, 1855 insertions(+) create mode 100644 .gitignore create mode 100644 CREDITS create mode 100644 LICENSE create mode 100644 README.md create mode 100644 bin/bookmarklet_fr.js create mode 100644 bin/bookmarklet_nl.js create mode 100644 lib/.placeholder create mode 100755 scripts/build create mode 100755 scripts/install create mode 100644 src/main.css create mode 100644 src/main.js create mode 100644 src/translations.json create mode 100644 src/utility.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26c8910 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/bookmarklet_*_*.js +lib/composer +lib/spotch diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..a5a062a --- /dev/null +++ b/CREDITS @@ -0,0 +1,22 @@ +Non-exhaustive list of people who contributed to this project. + +Name (N), email (E), web-address (W), description (D). + +--- + +N: Michaël Lecerf +E: michael@nurpa.be +D: Contributed to the JS code + +N: André Loconte +E: andre@nurpa.be +D: Original dev + +N: Laurent Peuch +E: laurent@nurpa.be +D: Contributed to the Bash code + +N: Wim Vandenbussche +E: wim@datapanik.org +W: http://datapanik.org +D: Dutch translation diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..62d10db --- /dev/null +++ b/LICENSE @@ -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. + + Better Lex bookmarklet Improve readability of the Belgian legislation. + Copyright (C) 2014 NURPA asbl + + 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: + + Better Lex bookmarklet Copyright (C) 2014 NURPA asbl + 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 +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7e3846a --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# Better Lex bookmarklet + +Better Lex bookmarklet is a tool for improving readability of the online Belgian consolidated legislation. It requires a modern Web browser, such as Firefox. + +## Overview + +Here is the structure of this project. + +``` +betterlex-bookmarklet +├── bin +│   ├── bookmarklet_fr.js +│   └── bookmarklet_nl.js +├── lib +├── scripts +│   ├── build +│   └── install +├── src +│   ├── main.css +│   ├── main.js +│   ├── translations.json +│   └── utility.js +├── CREDITS +├── LICENSE +└── README.md +``` + +## How to build the bookmarklet from scratch + +### Dependencies + +* PHP 5.4 or any newer version +* [Composer](https://getcomposer.org/), a package manager for PHP +* [spotch](https://github.com/miclf/spotch), a bookmarklet generator + +### Download and install dependencies + +You can use the following bash script to install the project’s dependencies. + +```bash +./scripts/install +``` + +### Build the bookmarklet + +Once the dependencies are installed, you just need to run this build script to generate both the French and Dutch versions of the bookmarklet. + +```bash +./scripts/build +``` + +## License + +This is free/libre software, made available under the terms of the [GNU General Public License (GPLv3)](LICENSE). diff --git a/bin/bookmarklet_fr.js b/bin/bookmarklet_fr.js new file mode 100644 index 0000000..6ec3a19 --- /dev/null +++ b/bin/bookmarklet_fr.js @@ -0,0 +1 @@ +javascript:(function(){var%20bookmarkletLang%20%3D%20%27fr%27%3B%20window._translations%20%3D%20%7B%0A%20%20%20%20%22fr%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22alertDefault%22%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20formulaire%20de%20recherche%20eJustel.%22%2C%0A%20%20%20%20%20%20%20%20%22alertFrame%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20document%20original.%5CnLorsque%20le%20document%20est%20charg%C3%A9%2C%20cliquez%20%C3%A0%20nouveau%20sur%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22alertTrans%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20document%20original.%5CnLorsque%20le%20document%20est%20charg%C3%A9%2C%20cliquez%20%C3%A0%20nouveau%20sur%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22dark%22%20%20%20%20%3A%20%22Sombre%22%2C%0A%20%20%20%20%20%20%20%20%22display%22%20%3A%20%22Th%5CxE8me%22%2C%0A%20%20%20%20%20%20%20%20%22font%22%20%20%20%20%3A%20%22Police%22%2C%0A%20%20%20%20%20%20%20%20%22infoBox%22%20%3A%20%22Survolez%20%5CxE0%20tout%20moment%20le%20bord%20gauche%20de%20la%20page%20pour%20afficher%20le%20menu.%22%2C%0A%20%20%20%20%20%20%20%20%22light%22%20%20%20%3A%20%22Clair%22%2C%0A%20%20%20%20%20%20%20%20%22nav%22%20%20%20%20%20%3A%20%22Navigation%22%2C%0A%20%20%20%20%20%20%20%20%22source%22%20%20%3A%20%22Document%20original%22%2C%0A%20%20%20%20%20%20%20%20%22trans%22%20%20%20%3A%20%22Version%20n%5CxE9erlandaise%22%2C%0A%20%20%20%20%20%20%20%20%22update%22%20%20%3A%20%22Rechercher%20mise%20%5CxE0%20jour%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22nl%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22alertDefault%22%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20zoekformulier%20eJustel.%22%2C%0A%20%20%20%20%20%20%20%20%22alertFrame%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20oorspronkelijk%20document.%5CnWanneer%20het%20document%20geladen%20is%2C%20klik%20nogmaals%20op%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22alertTrans%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20oorspronkelijk%20document.%5CnWanneer%20het%20document%20geladen%20is%2C%20klik%20nogmaals%20op%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22dark%22%20%20%20%20%3A%20%22Donker%22%2C%0A%20%20%20%20%20%20%20%20%22display%22%20%3A%20%22Weergave%22%2C%0A%20%20%20%20%20%20%20%20%22font%22%20%20%20%20%3A%20%22Lettertype%22%2C%0A%20%20%20%20%20%20%20%20%22infoBox%22%20%3A%20%22Beweeg%20je%20muis%20over%20de%20linkerrand%20van%20de%20pagina%20om%20het%20menu%20weer%20te%20geven.%22%2C%0A%20%20%20%20%20%20%20%20%22light%22%20%20%20%3A%20%22Licht%22%2C%0A%20%20%20%20%20%20%20%20%22nav%22%20%20%20%20%20%3A%20%22Navigatie%22%2C%0A%20%20%20%20%20%20%20%20%22source%22%20%20%3A%20%22Oorspronkelijk%20document%22%2C%0A%20%20%20%20%20%20%20%20%22trans%22%20%20%20%3A%20%22Franstalige%20versie%22%2C%0A%20%20%20%20%20%20%20%20%22update%22%20%20%3A%20%22Zoeken%20naarr%20updates%22%0A%20%20%20%20%7D%0A%7D%3B%0A%0Avar%20css%3D%27%2A%7Bbackground%3Anone%3Bborder%3Anone%3Bcolor%3Ainherit%3Bfont%3Ainherit%3B-webkit-box-sizing%3Aborder-box%3B-moz-box-sizing%3Aborder-box%3Bbox-sizing%3Aborder-box%3B%7Dhtml%7B-ms-text-size-adjust%3A100%25%3B-webkit-text-size-adjust%3A100%25%3B%7Dbody%7Bbackground%3A%23f8f8f8%3Bcolor%3A%23302c22%3Bfont-family%3AGeorgia%2Cserif%3Bline-height%3A1.4%3Bmargin%3A0%3Btransition%3Abackground%2Ccolor%20.2s%3B%7Dbody%2Ctd%7Bfont-size%3A16px%3B%7Da%7Bbackground%3Atransparent%3Bcolor%3A%232455c3%3Btext-decoration%3Anone%3B%7Da%3Ahover%2Ca%3Afocus%7Btext-decoration%3Aunderline%3B%7Dbr%7Bmargin-bottom%3A1em%3B%7Dinput%7Bline-height%3Anormal%3B%7Dsub%2Csup%7Bfont-size%3A75%25%3Bline-height%3A0%3Bposition%3Arelative%3Bvertical-align%3Abaseline%3B%7Dsup%7Btop%3A-0.5em%3B%7Dsub%7Bbottom%3A-0.25em%3B%7D%5Bclass%5E%3Dtable%5D%7Bmargin-top%3A5em%3Bwidth%3A100%25%3B%7D%5Bclass%5E%3Dtable%5D%20table%7Bwidth%3A100%25%3B%7D.pdf%7Bbackground%3Aurl%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAJgAAAFECAYAAADbSffBAAAEk0lEQVR42u3dMXLTUBSG0WvGHevwCtRSswQPJSntTYSULIC4YujZAdQu81bADtgApSgQ4AQgMXk%2FDuicjiLKjOabqyflIS2urq4uq2pT8MWuqrb3PcgwDFVVtayqzTAMC%2BeV1tr4ddgMw7DtccxHTis3LKpq01q7FBgR0xWtS2QCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikS2dEhKRtdbG1prA%2BMHYWut1rI3AuHl566a1NlqDESUwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbA4Faz2zI9var7ZOb2yngTDIEhMLAGm%2FhsjgmGwEBgWIP9feOJf7%2FnYCAwBAaeg2GCITAQGNZgf4PnYCYYAgOBYQ1mDWSCgcBwifwfDMPgJAjst%2B77HMwaziUSgSEwsAY7fpFuDWWCITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDH5rWVW71troVBCwWz57%2Bclp4FoUVbW970E%2BvH3ybYJtPrx94uME1Gq9H6tqM%2F1z2%2BOY1mDcnDyLKbJLgfHgI%2FNBUn5lUd%2B%2FrbkVGA8yMoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0Mtt1SES2Wa33lyYY0Um2Wu8FxnXTtuleNgLjm97%2FN2O13o%2FWYEQJDIEhMBAYAkNgIDAEhsBAYAgMgYHAEBgIDIEhMLjV7LZMd95zfrS5vTLeBENgCAwEhsBwFzkrd7nj8ylEEwyBITAQGAJDYNCFxxSTm3%2BEXq33d%2F3Rnz3K8OjCBLuu4y4LcQksFpm4BBaLTFwCi0UmLoHFJpK4BBaLTFwCi0UmLoHFIhOXwGKRiUtgJ1%2F4IzAEhsBAYJzM7LbrzO3dECYYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAQGAJDYCAwBIbA4HjLqtp1%2FCA6HNotXz1%2B%2FdF54MBFVb14%2BuZNl4Mt3j1%2FPlbVotcB%2BXe9Pzsbe0dmDcYPQ6eqzqvqxfuzsz6BmV58NbXQLTITjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEtnRIOHWyb7uFcYBxOn0XvWF0iiRIYAkNgIDAEhsBAYAgMgYHAEBgCA4EhMBAYAkNgcKvZbZnuvOf8aL23JZtguESCwBAYCAx3kQ%2FFXe74Tn1XaoIhMBAYAgOBITD%2BHx5TTP70j9A%2F%2BzmPLkywSkUhLoHF4hCXwGKRiEtgsVjEJbBYZOISWCwycQksFpm4BBaLTFwCi0UmLoE9mLtLBIbAEBgIjFOY3Xadub0bwgRDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDASGwBAYHG9ZVRe%2BwUPIxWfpNV1bZbmCywAAAABJRU5ErkJggg%3D%3D%29top%20left%20no-repeat%3Bdisplay%3Ablock%3Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3Bfont-size%3A16px%3Bheight%3A108px%3Bpadding%3A4.8em%200%200%20.8em%3Bwidth%3A152px%3B%7D.pdf%3Ahover%2C.pdf%3Afocus%7Bbackground-position%3A0%20-108px%3Bcolor%3A%232455c3%3Btext-decoration%3Anone%3B%7D%2F%2A%20headings%20%2A%2F%5Bclass%5E%3Dtable%5D%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%3Afirst-child%7Bdisplay%3Ablock%3Bfont-family%3AGeorgia%2Cserif%3Bfont-size%3A1.8em%3Bpadding-bottom%3A2em%3Btext-align%3Acenter%3Btext-transform%3Auppercase%3Bwidth%3A100%25%3B%7D%2F%2A%20sidebar------------------------%20%2A%2F.sidebar%7Bbackground%3A%23ebebeb%3Bborder-right%3A1px%20solid%20%23e6e6e6%3Bcolor%3A%23302c22%3Bdisplay%3Ainline-block%3Bheight%3A100%25%3Bleft%3A0%3Bmargin-left%3A-13rem%3Bopacity%3A0%3Boverflow%3Aauto%3Bposition%3Afixed%3Btop%3A0%3Btransition%3Amargin%20.3s%3Bwidth%3A16rem%3Bz-index%3A100%3B%7D.sidebar%3Ahover%7Bmargin-left%3A0%3Bopacity%3A1%3B%7D.sidebar%20%2A%7Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3B%7D.logo%7Bmargin%3A0%3B%7D.logo%20a%7Bdisplay%3Ablock%3Bfont-size%3A1.4em%3Bfont-weight%3Abold%3Bline-height%3A1%3Bpadding%3A1.5rem%3Btext-decoration%3Anone%3B%7D.logo%2C.sidebar%20%3E%20ul%7Bborder-bottom%3A1px%20solid%20%23e6e6e6%3B%7D.sidebar%20ul%7Blist-style-type%3Anone%3Bmargin%3A0%3Bpadding%3A0%3B%7D.sidebar%20%3E%20ul%20ul%7Bbackground%3Argba%28255%2C255%2C255%2C.6%29%3Bborder-top%3A1px%20dotted%20%23e6e6e6%3Bpadding%3A1rem%201.5rem%3B%7D.sidebar%20%3E%20ul%20ul%20a%7Bdisplay%3Ainline-block%3Bwidth%3A100%25%3B%7D.sidebar%20%3E%20ul%20%3E%20li%20%3E%20a%2C.sidebar%20.o%7Bdisplay%3Ablock%3Bpadding%3A.5rem%201.5rem%3B%7D.sidebar%20%3E%20ul%20%3E%20li%2Bli%7Bborder-top%3A1px%20solid%20%23e6e6e6%3B%7D.sidebar%20label%7Bcursor%3Apointer%3B%7D.sidebar%20label%5Bfor%3Dserif%5D%7Bfont-family%3AGeorgia%2Cserif%3B%7D.sidebar%20input%5Btype%3Dradio%5D%7Bmargin-right%3A.5rem%3Bvertical-align%3Abaseline%3B%7D.sidebar%20.footer%7Bfont-size%3A.8em%3Bpadding%3A0%201.5rem%3B%7D.sidebar%20.update%7Bmargin-top%3A2rem%3Btext-align%3Acenter%3B%7D.sidebar%20.update%20a%7Bdisplay%3Ainline-block%3Bpadding%3A.5em%201em%3B%7D%2F%2A%20info-box------------------------%20%2A%2F.info-box%7B-webkit-animation%3Aslide-down%20.6s%3Banimation%3Aslide-down%20.6s%3Bbackground%3A%23d8ecf5%3Bborder%3A1px%20solid%20%23aed7ea%3Bborder-radius%3A3px%3Bcolor%3A%235694b1%3Bcursor%3Apointer%3Bleft%3A1rem%3Bmax-width%3A75%25%3Bpadding%3A.5rem%201rem%3Bposition%3Afixed%3Btop%3A1rem%3Btransition%3Aopacity%201s%3B%7D.info-box%3Aafter%7Bbackground%3A%235694b1%3Bborder-radius%3A3px%3Bcolor%3A%23fff%3Bcontent%3A%22x%22%3Bdisplay%3Ablock%3Bline-height%3A1%3Bpadding%3A.2rem%20.4rem%3Bposition%3Aabsolute%3Bright%3A-.4rem%3Btop%3A-.4rem%3B%7D.info-box%20p%7Bmargin%3A0%3B%7D.hidden%7Bopacity%3A0%3B%7D%40-webkit-keyframes%20slide-down%7Bfrom%7B-webkit-transform%3AtranslateY%28-4rem%29%7Dto%7B-webkit-transform%3AtranslateY%280%29%7D%7D%40keyframes%20slide-down%7Bfrom%7Btransform%3AtranslateY%28-4rem%29%7Dto%7Btransform%3AtranslateY%280%29%7D%7D%2F%2A%20content------------------------%20%2A%2F.content%7Bmargin%3A0%20auto%3Bmax-width%3A47.5em%3B%7D%2F%2A%20table-titre------------------------%20%2A%2F.table-titre%20span%7Bdisplay%3Ablock%3Bfont-weight%3Abold%3Bmargin%3A1em%200%20.5em%200%3B%7D.table-titre%20br%7Bmargin%3A0%3B%7D.table-titre%20.pdf%7Bmargin-top%3A1em%3B%7D%2F%2A%20table-modification------------------------%20%2A%2F.table-modification%20br%7Bmargin%3A0%3B%7D.table-modification%20tr%2Btr%7Bborder-top%3A1px%20dotted%20%23ccc%3Bdisplay%3Ablock%3Bpadding%3A.5em%200%3Btext-transform%3Alowercase%3B%7D.table-modification%20tr%3Anth-of-type%283%29%7Bborder-top%3Anone%3Bmargin-top%3A0%3Bpadding-top%3A0%3B%7D.table-modification%20tr%3Alast-of-type%7Bpadding-bottom%3A0%3B%7D.table-modification%20.pdf%7Bdisplay%3Ainline-block%3Bmargin-right%3A1.5rem%3B%7D.table-modification%20.pdf%2Bli%7Bmax-width%3Acalc%28100%25%20-%201.5rem%20-%20152px%29%3B%7D.table-modification%20li%7Bdisplay%3Ainline-block%3Blist-style-type%3Anone%3Bvertical-align%3Atop%3B%7D.table-modification%20li%20span%7Bcolor%3A%237f7f7f%3B%7D%2F%2A%20table-texte------------------------%20%2A%2F.title%2C.article%2C.chapter%2C.section%2C.subsection%7Bcolor%3A%23000%3Bdisplay%3Ablock%3Bfont-family%3AGeorgia%2Cserif%3Bline-height%3A1.2%3Bmargin%3A1.5rem%200%3B%7D.article%7Bborder%3A1px%20solid%20%23ccc%3Bfont-size%3A1.3em%3Bline-height%3A1.4%3Bmargin%3A1.5rem%200%201rem%200%3Bpadding%3A.2em%20.5em%3B%7D.chapter%7Bfont-size%3A1.8em%3Bfont-weight%3Anormal%3B%7D.title%7Bbackground%3A%23efefef%3Bfont-size%3A1.5em%3Bpadding%3A.2em%20.5em%3B%7Dtd%20.title%3Afirst-child%2Ctd%20.chapter%3Afirst-child%7Bmargin-top%3A0%3B%7D.section%7Bcolor%3A%23b96060%3Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3Bfont-size%3A1.5em%3B%7D.subsection%7Bfont-weight%3Abold%3B%7D%2F%2A%20quirks------------------------%20%2A%2F.table-hit0%2C.table-end%2Ctable%20%3E%20br%3Afirst-child%2Ctd%20%3E%20br%3Afirst-child%2Ctd%20%3E%20br%3Alast-child%2Ctr%20%3E%20br%3Afirst-child%2Ctr%20%3E%20br%3Alast-child%2C.title%2Bbr%2C.chapter%2Bbr%2C.section%2Bbr%2C.subsection%2Bbr%2C%5Bclass%5E%3Dtable%5D%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%2Btd%2C.table-modification%20tr%3Anth-of-type%282%29%7Bdisplay%3Anone%3B%7D%2F%2A%20dark------------------------%20%2A%2F.dark%7Bbackground%3A%23212324%3Bcolor%3A%23ddd%3B%7D.dark%20a%7Bcolor%3A%23b96060%3B%7D%2F%2A%20nav-sidebar%20%2A%2F.dark%20.sidebar%7Bbackground%3A%231b1d1e%3Bborder-right-color%3A%23151617%3Bcolor%3A%23ddd%3B%7D.dark%20.sidebar%20%2A%7Bborder-color%3A%23151617%3B%7D.dark%20.sidebar%20%3E%20ul%20ul%7Bbackground%3Argba%28255%2C255%2C255%2C.05%29%3B%7D%2F%2A%20table-titre%20%2A%2F.dark%20.table-titre%20.pdf%3Ahover%2C.dark%20.table-titre%20.pdf%3Afocus%2C.dark%20.table-modification%20a%3Ahover%2C.dark%20.table-modification%20a%3Afocus%7Bbackground-position%3A0%20-216px%3Bcolor%3A%23b96060%3Btext-decoration%3Anone%3B%7D%2F%2A%20table-texte%20%2A%2F.dark%20.title%2C.dark%20.article%2C.dark%20.chapter%2C.dark%20.section%2C.dark%20.subsection%7Bcolor%3A%23fff%3B%7D.dark%20.article%7Bborder-color%3A%23333%3B%7D.dark%20.title%7Bbackground%3A%23333%3B%7D.dark%20.section%7Bcolor%3A%23b96060%3B%7D%2F%2A%20table-modification%20%2A%2F.dark%20.table-modification%20tr%2Btr%7Bborder-top-color%3A%23333%3B%7D%2F%2A%20sans-serif------------------------%20%2A%2F.sans-serif%7Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3B%7D%2F%2A%20media%20queries------------------------%20%2A%2F%40media%20handheld%2C%28max-width%3A1000px%29%7Bbody%7Bmargin%3A0%201.5rem%3B%7D%7D%40media%20print%7B%2A%2C%2A%3Abefore%2C%2A%3Aafter%7Bbackground%3Atransparent%20%21important%3Bcolor%3A%23000%20%21important%3Bbox-shadow%3Anone%20%21important%3Btext-shadow%3Anone%20%21important%3B%7Dbody%2Ctd%7Bfont-size%3A10pt%3B%7D.pdf%7Bdisplay%3Ablock%3Bwidth%3Aauto%3Bheight%3Aauto%3Bpadding%3A0%3Bfont%3Ainherit%3Btext-transform%3Alowercase%3B%7D.pdf%3Abefore%7Bcontent%3A%22%28%22%3B%7D.pdf%3Aafter%7Bcontent%3A%22%29%5C%20%22%20attr%28href%29%3B%7D.info-box%7Bdisplay%3Anone%3B%7D.title%2C.article%2C.chapter%2C.section%2C.subsection%7Bpage-break-after%3Aavoid%3B%7D.article%7Bfont-size%3A1em%3B%7D.chapter%7Bfont-size%3A1.5em%3B%7D.title%7Bfont-size%3A1.3em%3B%7D%7D%27%3B%0A%2F%2A%2A%2A%20Checkifthe%20document%20has%20already%20been%20parsed.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isAlreadyParsed%28%29%7Breturn%20%21%21%28d.getElementsByClassName%28%27better-lex%27%29%5B0%5D%29%3B%7D%2F%2A%2A%2A%20Try%20to%20detect%20the%20language%20of%20the%20document.%2A%20If%20none%20is%20found%2Creturn%20the%20value%20of%20the%2A%20global%20%60bookmarkletLang%60%20variable.%2A%2A%20%40param%7Bstring%7Durl%2A%20%40return%7Bstring%7D%2A%2Ffunction%20detectLang%28url%29%7Bvar%20lang%3Durl.match%28%2Flanguage%3D%28nl%7Cfr%29%2Fi%29%3Bif%28lang%29return%20lang%5B1%5D%3Breturn%20bookmarkletLang%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20Better%20Lex%20website.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnBetterLex%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20page%20of%20a%20document.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnDocument%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a1.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20document%20is%20contained%20inside%20a%20frame.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnFrame%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20page%20is%20viewed%20locally.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnLocal%28%29%7Breturn%20%21%21%28url.match%28%2F%5E%28file%7Chttp%3A%5C%2F%5C%2F%28127%7Clocalhost%29%29%2Fi%29%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20eJustel%20search%20page.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnSearch%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_rech.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20a%20translation%20page.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnTranslation%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Fchange_lg.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Build%20a%20new%20URL%20from%20an%20URL%20and%2Coptionally%2Ca%20language%20code.%2A%2A%20%40param%7Bstring%7Durl%2A%20%40param%7Bstring%7Dtrans%2A%20%40return%7Bstring%7D%2A%2Ffunction%20reconstructURL%28url%2Ctrans%29%7Bvar%20cn%3Durl.match%28%2Fcn%3D%28%5B%5E%26%5D%2B%29%2Fi%29%2Clang%3Dtrans%20%3F%20trans%3AdetectLang%28url%29%2Cfromtab%3D%28lang%20%3D%3D%3D%20%27fr%27%29%3F%20%27loi%27%3A%27wet%27%3Bvar%20target%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a1.pl%3Fcaller%3Dlist%27%2B%27%26cn%3D%27%2Bcn%5B1%5D%2B%27%26language%3D%27%2Blang%2B%27%26fromtab%3D%27%2Bfromtab%3Breturn%20target%3B%7D%2F%2A%2A%2A%20Remove%20all%20the%20attributes%20of%20an%20HTML%20element.%2A%2A%20%40param%7BHTMLElement%7Delement%2A%20%40return%7Bvoid%7D%2A%2Ffunction%20removeAllAttrs%28element%29%7Bfor%28var%20i%3Delement.attributes.length%3B%20i--%20%3E%200%3B%29%7Belement.removeAttribute%28element.attributes%5Bi%5D%29%3B%7D%7D%0A%2F%2AThe%20following%20variables%20are%20created%20by%20the%20build%20script%3A-%20%22window._translations%22%20based%20upon%20the%20content%20of%20%22src%2Ftranslations.json%22-%20%22css%22%20based%20upon%20the%20content%20of%20%22src%2Fmain.css%22-%20%22bookmarkletLang%22%20equals%20either%20%22fr%22%20or%20%22nl%22%2A%2Fvar%20version%3D%271.0%27%3Bvar%20d%3Ddocument%2Cb%3Dd.body%2Cw%3Dwindow%3Bvar%20url%3Dd.location.href%3Bvar%20lang%3DdetectLang%28url%29%3Bvar%20alternateLang%3D%28lang%20%3D%3D%3D%20%27fr%27%29%3F%20%27nl%27%3A%27fr%27%3Bvar%20trans%3Dw._translations%5Blang%5D%3Bif%28%28isOnDocument%28%29%7C%7CisOnLocal%28%29%29%26%26%21isAlreadyParsed%28%29%29%7Bvar%20stylesheet%3Dd.createElement%28%27style%27%29%3Bstylesheet.innerHTML%3Dcss%3Bd.head.appendChild%28stylesheet%29%3BremoveAllAttrs%28b%29%3B%2F%2A1.%20%20Markup%20homogenization2.%20%20New%20lines%20are%20removed%20to%20ease%20later%20parsing3.%20%20%3Cb%3E%2C%3Cfont%3E%20and%20%3Cspan%3E%20are%20removed4%20%20%20%3Ca%3E%20linking%20to%20%22%23t%22%20or%20having%20a%20title%20are%20deleted.%20Typically%20usedfor%20reference%20to%20footnote%2Cuseless%20and%20would%20complexify%20the%20parsing5.%20%20Empty%20%3Ctd%3E%20or%20%3Ctr%3E%20elements%20are%20removed6.%20%20Identifiers%20and%20classes%20are%20added%20to%20every%20table%20according%20to%20thevalue%20of%20the%20preceding%20hidden%20%3Ca%3E%20anchor7.%20%20Any%28misused%29%3Cth%3E%20is%20replaced%20by%20a%20%3Ctd%3E8.%20%20Typographic%20improvements%2A%2Fb.innerHTML%3Db.innerHTML.replace%28%2F%28%3F%3A%3C%5C%2F%3Fbr%5C%2F%3F%3E%5Cs%3F%29%2B%2Fgi%2C%27%3Cbr%3E%27%29.replace%28%2F%5B%5Cn%7C%5Cr%5D%2Fgi%2C%27%27%29.replace%28%2F%3C%5C%2F%3Fb%3E%2Fgi%2C%27%27%29.replace%28%2F%3C%5C%2F%3F%28%3F%3Afont%7Cspan%29%5B%5E%3E%5D%2A%3F%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ca%28%3F%3A%20%28%3F%3Ahref%3D%22%23t%22%7Ctitle%3D%22%5B%5E%22%5D%2B%22%29%29%2B%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Fa%3E%2Fgi%2C%27%241%27%29.replace%28%2F%3Ctd%5B%5E%3E%5D%2A%3F%3E%5Cs%2A%3F%3C%5C%2Ftd%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ctr%5B%5E%3E%5D%2A%3F%3E%5Cs%2A%3F%3C%5C%2Ftr%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ca%20name%3D%22%28%5B%5E%22%5D%2B%29%22%3E%5B%5E%3E%5D%2A%3F%3C%5C%2Fa%3E%28%3F%3A%3Cbr%3E%7C%5Cs%29%2A%3Ctable%5B%5E%3E%5D%2B%3E%2Fgi%2C%27%3Ctable%20id%3D%22%241%22%20class%3D%22table-%241%22%3E%27%29.replace%28%2F%3C%28%5C%2F%3F%29th%5B%5E%3E%5D%2A%3F%3E%2Fgi%2C%27%3C%241td%3E%27%29.replace%28%2FCHAPITRE%2Fg%2C%27Chapitre%27%29.replace%28%2FHOOFDSTUK%2Fg%2C%27Hoofdstuk%27%29.replace%28%2FTITRE%2Fg%2C%27Titre%27%29.replace%28%2FTITEL%2Fg%2C%27Titel%27%29.replace%28%2FANNEXES%2Fg%2C%27Annexes%27%29.replace%28%2FBIJLAGEN%2Fg%2C%27Bijlagen%27%29.replace%28%2FANNEXE%2Fg%2C%27Annexe%27%29.replace%28%2FBIJLAGE%2Fg%2C%27Bijlage%27%29%3Bb.innerHTML%3D%27%3Cdiv%20class%3D%22wrapper%20better-lex%22%3E%3Cdiv%20class%3D%22content%22%3E%27%2Bb.innerHTML%2B%27%3C%2Fdiv%3E%3C%2Fdiv%3E%27%3Bvar%20headingsTable%3Db.getElementsByClassName%28%27table-titre%27%29%5B0%5D%3B%2F%2A1.%20%20Titles%20are%20wrapped%20in%20%3Cspan%3E%20elements2.%20%20In%20cases%20where%20various%20values%20are%20provided%20and%20separated%20by%20%22%2A%22%2C%22%2A%22%20is%20replaced%20by%20%3Cbr%3E3.%20%20%22pdf%22%20class%20is%20added%20to%20link%20pointing%20to%20an%20%22image%22%2Cwordingis%20fixed%2CURL%20is%20fixed%20as%20well%2A%2FheadingsTable.innerHTML%3DheadingsTable.innerHTML.replace%28%2F%3Cbr%3E%5B%5E%5C%28%5D%28%5B%5E%3A%5D%2B%20%3A%29%2Fg%2C%27%3Cspan%3E%241%3C%2Fspan%3E%27%29.replace%28%2F%28%3F%3A%26nbsp%3B%7C%20%29%2B%5B%5C%2A%5D%2B%28%3F%3A%26nbsp%3B%7C%20%29%2B%2Fg%2C%27%3Cbr%3E%27%29.replace%28%2F%3Ca%5B%5E%3E%5D%2Bhref%3D%22%5B%5E%22%5D%2Bpdf_file%3D%28%5B%5E%22%5D%2B%5C.pdf%29%22%5B%5E%3E%5D%2B%3E%28%3F%3Aimage%7Cbeeld%29%3C%5C%2Fa%3E%2Fgi%2C%27%3Ca%20href%3D%22%241%22%20class%3D%22pdf%22%3Epdf%3C%2Fa%3E%27%29%3Bvar%20textTable%3Db.getElementsByClassName%28%27table-texte%27%29%5B0%5D%3BtextTable.innerHTML%3DtextTable.innerHTML.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%3Ca%20name%3D%22%28Art%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%5B%5E%3C%5D%2B%3C%5C%2Fa%3E%28%3F%3A%20%3F%3Ca%5B%5E%3E%5D%2B%3E%5B%5E%3E%5D%2B%3E%5B.%20%5D%2B%7C%20%3F%5B%5E%20%5D%2B%20%3F%29%28%3F%3A%3Cbr%3E%29%2A%2Fgi%2C%27%3Ca%20class%3D%22article%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%241%3C%2Fa%3E%26nbsp%3B%26nbsp%3B%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Achapitre%7Choofdstuk%7Cannexes%3F%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22chapter%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Atitre%7Ctitel%29.%2A%3F%29%3C%5C%2Fa%3E%28%5B%5E%3C%5D%2B%29%29%2Fgi%2C%27%3Ca%20class%3D%22title%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Asection%7Cafdeling%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22section%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Asous-section%7Conderafdeling%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22subsection%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29%3Bvar%20modificationTable%3Db.getElementsByClassName%28%27table-modification%27%29%5B0%5D%3B%2F%2A1.%20%20%22pdf%22%20class%20is%20added%20to%20link%20pointing%20to%20an%20%22image%22%2Cwordingis%20fixed%2CURL%20is%20fixed%20as%20well2.%20%20Modification%20details%20are%20wrapped%20in%20%3Cspan%3E%2A%2Fif%28modificationTable%29%7BmodificationTable.innerHTML%3DmodificationTable.innerHTML.replace%28%2F%3Ca%5B%5E%3E%5D%2Bhref%3D%22%5B%5E%22%5D%2Bpdf_file%3D%28%5B%5E%22%5D%2B%5C.pdf%29%22%5B%5E%3E%5D%2B%3E%28%3F%3Aimage%7Cbeeld%29%3C%5C%2Fa%3E%2Fgi%2C%27%3Ca%20href%3D%22%241%22%20class%3D%22pdf%22%3Epdf%3C%2Fa%3E%27%29.replace%28%2F%3Cbr%3E%28.%2A%3F%29%3C%5C%2Fli%3E%2Fgi%2C%27%3Cbr%3E%3Cspan%3E%241%3C%2Fspan%3E%3C%2Fli%3E%27%29%3B%7Dvar%20sidebar%3Dd.createElement%28%27div%27%29%3Bsidebar.setAttribute%28%27class%27%2C%27sidebar%27%29%3Bvar%20mainTables%3D%5B%5D.slice.call%28d.querySelectorAll%28%27%5Bclass%5E%3Dtable%5D%27%29%29%3Bvar%20uselessTablesIds%3D%5B%27hit0%27%2C%27end%27%5D%3Bvar%20toc%3D%5B%5D%3BmainTables.forEach%28function%28item%29%7Bif%28uselessTablesIds.indexOf%28item.id%29%3D%3D%3D%20-1%29%7Bvar%20selector%3D%27%23%27%2Bitem.id%2B%27%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%3Afirst-child%27%3Bvar%20li%3D%27%3Cli%3E%3Ca%20href%3D%22%23%27%2Bitem.id%2B%27%22%3E%27%2Bd.querySelector%28selector%29.innerHTML%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%3Btoc.push%28li%29%3B%7D%20%7D%29%3Bsidebar.innerHTML%3D%27%3Cp%20class%3D%22logo%22%3E%3Ca%20href%3D%22%23%22%3EBetter%20Lex%3C%2Fa%3E%3C%2Fp%3E%27%2B%27%3Cul%3E%27%2B%27%20%20%20%3Cli%3E%3Ca%20href%3D%22%27%2Burl%2B%27%22%20target%3D%22_blank%22%3E%27%2Btrans.source%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Ca%20href%3D%22%27%2BreconstructURL%28url%2CalternateLang%29%2B%27%22%20class%3D%22trans%22%3E%27%2Btrans.trans%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.nav%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2Btoc.join%28%27%27%29%2B%27%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.display%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22theme%22%20id%3D%22dark%22%20%2F%3E%3Clabel%20for%3D%22dark%22%3E%27%20%2B%20trans.dark%20%2B%20%27%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22theme%22%20id%3D%22light%22%20checked%3D%22checked%22%20%2F%3E%3Clabel%20for%3D%22light%22%3E%27%20%2B%20trans.light%20%2B%20%27%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.font%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22font%22%20id%3D%22serif%22%20checked%3D%22checked%22%20%2F%3E%3Clabel%20for%3D%22serif%22%3ESerif%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22font%22%20id%3D%22sans-serif%22%20%2F%3E%3Clabel%20for%3D%22sans-serif%22%3ESans-serif%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%3C%2Ful%3E%27%2B%27%3Cp%20class%3D%22footer%22%3E%3Ca%20title%3D%22Source%20code%20on%20GitHub%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fnurpa%2Fbetter-lex%2F%22%3EBetter%20Lex%3C%2Fa%3E%20version%20%27%2Bversion%2B%27%3C%2Fp%3E%27%2B%27%3Cp%20class%3D%22footer%20update%22%3E%3Ca%20href%3D%22http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%3Fversion%3D%27%2Bversion%2B%27%26lang%3D%27%2Blang%2B%27%22%3E%27%2Btrans.update%2B%27%3C%2Fa%3E%3C%2Fp%3E%27%3Bb.insertBefore%28sidebar%2Cb.firstChild%29%3Bd.getElementById%28%27dark%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.add%28%27dark%27%29%3B%7D%29%3Bd.getElementById%28%27light%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.remove%28%27dark%27%29%3B%7D%29%3Bd.getElementById%28%27serif%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.remove%28%27sans-serif%27%29%3B%7D%29%3Bd.getElementById%28%27sans-serif%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.add%28%27sans-serif%27%29%3B%7D%29%3Bvar%20infoBox%3Dd.createElement%28%27div%27%29%3BinfoBox.setAttribute%28%27class%27%2C%27info-box%20sans-serif%27%29%3BinfoBox.innerHTML%3D%27%3Cp%3E%27%2Btrans.infoBox%2B%27%3C%2Fp%3E%27%3Bb.appendChild%28infoBox%29%3B%2F%2AHide%20the%20info%20box%3A-%20when%20the%20sidebar%20is%20opened-%20when%20the%20info%20box%20is%20clicked%20upon-%20after%207%20seconds%2A%2Fsidebar.addEventListener%28%27mouseover%27%2Cfunction%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%29%3BinfoBox.addEventListener%28%27click%27%2Cfunction%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%29%3Bw.setTimeout%28function%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%2C7000%29%3BinfoBox.addEventListener%28%27transitionend%27%2Cfunction%28%29%7BinfoBox.style.display%3D%27none%27%3B%7D%29%3B%7Delse%20if%28isOnBetterLex%28%29%29%7Bd.location%3D%27http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%3Fversion%3D%27%2Bversion%2B%27%26lang%3D%27%2Blang%3B%7Delse%20if%28isOnFrame%28%29%29%7Balert%28trans.alertFrame%29%3Bvar%20oldUrl%3Ddocument.getElementsByTagName%28%27frame%27%29%5B0%5D.getAttribute%28%27src%27%29%3Bd.location%3DreconstructURL%28oldUrl%29%3B%7Delse%20if%28isOnTranslation%28%29%29%7Balert%28trans.alertTrans%29%3Bd.location%3DreconstructURL%28url%29%3B%7Delse%20if%28isOnSearch%28%29%7C%7CisAlreadyParsed%28%29%29%7B%7Delse%7Balert%28trans.alertDefault%29%3Bd.location%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_rech.pl%3Flanguage%3D%27%2BbookmarkletLang%3B%7D})(); \ No newline at end of file diff --git a/bin/bookmarklet_nl.js b/bin/bookmarklet_nl.js new file mode 100644 index 0000000..e1bc9fb --- /dev/null +++ b/bin/bookmarklet_nl.js @@ -0,0 +1 @@ +javascript:(function(){var%20bookmarkletLang%20%3D%20%27nl%27%3B%20window._translations%20%3D%20%7B%0A%20%20%20%20%22fr%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22alertDefault%22%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20formulaire%20de%20recherche%20eJustel.%22%2C%0A%20%20%20%20%20%20%20%20%22alertFrame%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20document%20original.%5CnLorsque%20le%20document%20est%20charg%C3%A9%2C%20cliquez%20%C3%A0%20nouveau%20sur%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22alertTrans%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnRedirection%20vers%20le%20document%20original.%5CnLorsque%20le%20document%20est%20charg%C3%A9%2C%20cliquez%20%C3%A0%20nouveau%20sur%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22dark%22%20%20%20%20%3A%20%22Sombre%22%2C%0A%20%20%20%20%20%20%20%20%22display%22%20%3A%20%22Th%5CxE8me%22%2C%0A%20%20%20%20%20%20%20%20%22font%22%20%20%20%20%3A%20%22Police%22%2C%0A%20%20%20%20%20%20%20%20%22infoBox%22%20%3A%20%22Survolez%20%5CxE0%20tout%20moment%20le%20bord%20gauche%20de%20la%20page%20pour%20afficher%20le%20menu.%22%2C%0A%20%20%20%20%20%20%20%20%22light%22%20%20%20%3A%20%22Clair%22%2C%0A%20%20%20%20%20%20%20%20%22nav%22%20%20%20%20%20%3A%20%22Navigation%22%2C%0A%20%20%20%20%20%20%20%20%22source%22%20%20%3A%20%22Document%20original%22%2C%0A%20%20%20%20%20%20%20%20%22trans%22%20%20%20%3A%20%22Version%20n%5CxE9erlandaise%22%2C%0A%20%20%20%20%20%20%20%20%22update%22%20%20%3A%20%22Rechercher%20mise%20%5CxE0%20jour%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22nl%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22alertDefault%22%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20zoekformulier%20eJustel.%22%2C%0A%20%20%20%20%20%20%20%20%22alertFrame%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20oorspronkelijk%20document.%5CnWanneer%20het%20document%20geladen%20is%2C%20klik%20nogmaals%20op%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22alertTrans%22%20%20%20%3A%20%22Better%20Lex%5Cn%5CnTerug%20naar%20het%20oorspronkelijk%20document.%5CnWanneer%20het%20document%20geladen%20is%2C%20klik%20nogmaals%20op%20%5C%22Better%20Lex%5C%22.%22%2C%0A%20%20%20%20%20%20%20%20%22dark%22%20%20%20%20%3A%20%22Donker%22%2C%0A%20%20%20%20%20%20%20%20%22display%22%20%3A%20%22Weergave%22%2C%0A%20%20%20%20%20%20%20%20%22font%22%20%20%20%20%3A%20%22Lettertype%22%2C%0A%20%20%20%20%20%20%20%20%22infoBox%22%20%3A%20%22Beweeg%20je%20muis%20over%20de%20linkerrand%20van%20de%20pagina%20om%20het%20menu%20weer%20te%20geven.%22%2C%0A%20%20%20%20%20%20%20%20%22light%22%20%20%20%3A%20%22Licht%22%2C%0A%20%20%20%20%20%20%20%20%22nav%22%20%20%20%20%20%3A%20%22Navigatie%22%2C%0A%20%20%20%20%20%20%20%20%22source%22%20%20%3A%20%22Oorspronkelijk%20document%22%2C%0A%20%20%20%20%20%20%20%20%22trans%22%20%20%20%3A%20%22Franstalige%20versie%22%2C%0A%20%20%20%20%20%20%20%20%22update%22%20%20%3A%20%22Zoeken%20naarr%20updates%22%0A%20%20%20%20%7D%0A%7D%3B%0A%0Avar%20css%3D%27%2A%7Bbackground%3Anone%3Bborder%3Anone%3Bcolor%3Ainherit%3Bfont%3Ainherit%3B-webkit-box-sizing%3Aborder-box%3B-moz-box-sizing%3Aborder-box%3Bbox-sizing%3Aborder-box%3B%7Dhtml%7B-ms-text-size-adjust%3A100%25%3B-webkit-text-size-adjust%3A100%25%3B%7Dbody%7Bbackground%3A%23f8f8f8%3Bcolor%3A%23302c22%3Bfont-family%3AGeorgia%2Cserif%3Bline-height%3A1.4%3Bmargin%3A0%3Btransition%3Abackground%2Ccolor%20.2s%3B%7Dbody%2Ctd%7Bfont-size%3A16px%3B%7Da%7Bbackground%3Atransparent%3Bcolor%3A%232455c3%3Btext-decoration%3Anone%3B%7Da%3Ahover%2Ca%3Afocus%7Btext-decoration%3Aunderline%3B%7Dbr%7Bmargin-bottom%3A1em%3B%7Dinput%7Bline-height%3Anormal%3B%7Dsub%2Csup%7Bfont-size%3A75%25%3Bline-height%3A0%3Bposition%3Arelative%3Bvertical-align%3Abaseline%3B%7Dsup%7Btop%3A-0.5em%3B%7Dsub%7Bbottom%3A-0.25em%3B%7D%5Bclass%5E%3Dtable%5D%7Bmargin-top%3A5em%3Bwidth%3A100%25%3B%7D%5Bclass%5E%3Dtable%5D%20table%7Bwidth%3A100%25%3B%7D.pdf%7Bbackground%3Aurl%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAJgAAAFECAYAAADbSffBAAAEk0lEQVR42u3dMXLTUBSG0WvGHevwCtRSswQPJSntTYSULIC4YujZAdQu81bADtgApSgQ4AQgMXk%2FDuicjiLKjOabqyflIS2urq4uq2pT8MWuqrb3PcgwDFVVtayqzTAMC%2BeV1tr4ddgMw7DtccxHTis3LKpq01q7FBgR0xWtS2QCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikS2dEhKRtdbG1prA%2BMHYWut1rI3AuHl566a1NlqDESUwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbA4Faz2zI9var7ZOb2yngTDIEhMLAGm%2FhsjgmGwEBgWIP9feOJf7%2FnYCAwBAaeg2GCITAQGNZgf4PnYCYYAgOBYQ1mDWSCgcBwifwfDMPgJAjst%2B77HMwaziUSgSEwsAY7fpFuDWWCITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDH5rWVW71troVBCwWz57%2Bclp4FoUVbW970E%2BvH3ybYJtPrx94uME1Gq9H6tqM%2F1z2%2BOY1mDcnDyLKbJLgfHgI%2FNBUn5lUd%2B%2FrbkVGA8yMoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0Mtt1SES2Wa33lyYY0Um2Wu8FxnXTtuleNgLjm97%2FN2O13o%2FWYEQJDIEhMBAYAkNgIDAEhsBAYAgMgYHAEBgIDIEhMLjV7LZMd95zfrS5vTLeBENgCAwEhsBwFzkrd7nj8ylEEwyBITAQGAJDYNCFxxSTm3%2BEXq33d%2F3Rnz3K8OjCBLuu4y4LcQksFpm4BBaLTFwCi0UmLoHFJpK4BBaLTFwCi0UmLoHFIhOXwGKRiUtgJ1%2F4IzAEhsBAYJzM7LbrzO3dECYYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAQGAJDYCAwBIbA4HjLqtp1%2FCA6HNotXz1%2B%2FdF54MBFVb14%2BuZNl4Mt3j1%2FPlbVotcB%2BXe9Pzsbe0dmDcYPQ6eqzqvqxfuzsz6BmV58NbXQLTITjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEtnRIOHWyb7uFcYBxOn0XvWF0iiRIYAkNgIDAEhsBAYAgMgYHAEBgCA4EhMBAYAkNgcKvZbZnuvOf8aL23JZtguESCwBAYCAx3kQ%2FFXe74Tn1XaoIhMBAYAgOBITD%2BHx5TTP70j9A%2F%2BzmPLkywSkUhLoHF4hCXwGKRiEtgsVjEJbBYZOISWCwycQksFpm4BBaLTFwCi0UmLoE9mLtLBIbAEBgIjFOY3Xadub0bwgRDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDASGwBAYHG9ZVRe%2BwUPIxWfpNV1bZbmCywAAAABJRU5ErkJggg%3D%3D%29top%20left%20no-repeat%3Bdisplay%3Ablock%3Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3Bfont-size%3A16px%3Bheight%3A108px%3Bpadding%3A4.8em%200%200%20.8em%3Bwidth%3A152px%3B%7D.pdf%3Ahover%2C.pdf%3Afocus%7Bbackground-position%3A0%20-108px%3Bcolor%3A%232455c3%3Btext-decoration%3Anone%3B%7D%2F%2A%20headings%20%2A%2F%5Bclass%5E%3Dtable%5D%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%3Afirst-child%7Bdisplay%3Ablock%3Bfont-family%3AGeorgia%2Cserif%3Bfont-size%3A1.8em%3Bpadding-bottom%3A2em%3Btext-align%3Acenter%3Btext-transform%3Auppercase%3Bwidth%3A100%25%3B%7D%2F%2A%20sidebar------------------------%20%2A%2F.sidebar%7Bbackground%3A%23ebebeb%3Bborder-right%3A1px%20solid%20%23e6e6e6%3Bcolor%3A%23302c22%3Bdisplay%3Ainline-block%3Bheight%3A100%25%3Bleft%3A0%3Bmargin-left%3A-13rem%3Bopacity%3A0%3Boverflow%3Aauto%3Bposition%3Afixed%3Btop%3A0%3Btransition%3Amargin%20.3s%3Bwidth%3A16rem%3Bz-index%3A100%3B%7D.sidebar%3Ahover%7Bmargin-left%3A0%3Bopacity%3A1%3B%7D.sidebar%20%2A%7Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3B%7D.logo%7Bmargin%3A0%3B%7D.logo%20a%7Bdisplay%3Ablock%3Bfont-size%3A1.4em%3Bfont-weight%3Abold%3Bline-height%3A1%3Bpadding%3A1.5rem%3Btext-decoration%3Anone%3B%7D.logo%2C.sidebar%20%3E%20ul%7Bborder-bottom%3A1px%20solid%20%23e6e6e6%3B%7D.sidebar%20ul%7Blist-style-type%3Anone%3Bmargin%3A0%3Bpadding%3A0%3B%7D.sidebar%20%3E%20ul%20ul%7Bbackground%3Argba%28255%2C255%2C255%2C.6%29%3Bborder-top%3A1px%20dotted%20%23e6e6e6%3Bpadding%3A1rem%201.5rem%3B%7D.sidebar%20%3E%20ul%20ul%20a%7Bdisplay%3Ainline-block%3Bwidth%3A100%25%3B%7D.sidebar%20%3E%20ul%20%3E%20li%20%3E%20a%2C.sidebar%20.o%7Bdisplay%3Ablock%3Bpadding%3A.5rem%201.5rem%3B%7D.sidebar%20%3E%20ul%20%3E%20li%2Bli%7Bborder-top%3A1px%20solid%20%23e6e6e6%3B%7D.sidebar%20label%7Bcursor%3Apointer%3B%7D.sidebar%20label%5Bfor%3Dserif%5D%7Bfont-family%3AGeorgia%2Cserif%3B%7D.sidebar%20input%5Btype%3Dradio%5D%7Bmargin-right%3A.5rem%3Bvertical-align%3Abaseline%3B%7D.sidebar%20.footer%7Bfont-size%3A.8em%3Bpadding%3A0%201.5rem%3B%7D.sidebar%20.update%7Bmargin-top%3A2rem%3Btext-align%3Acenter%3B%7D.sidebar%20.update%20a%7Bdisplay%3Ainline-block%3Bpadding%3A.5em%201em%3B%7D%2F%2A%20info-box------------------------%20%2A%2F.info-box%7B-webkit-animation%3Aslide-down%20.6s%3Banimation%3Aslide-down%20.6s%3Bbackground%3A%23d8ecf5%3Bborder%3A1px%20solid%20%23aed7ea%3Bborder-radius%3A3px%3Bcolor%3A%235694b1%3Bcursor%3Apointer%3Bleft%3A1rem%3Bmax-width%3A75%25%3Bpadding%3A.5rem%201rem%3Bposition%3Afixed%3Btop%3A1rem%3Btransition%3Aopacity%201s%3B%7D.info-box%3Aafter%7Bbackground%3A%235694b1%3Bborder-radius%3A3px%3Bcolor%3A%23fff%3Bcontent%3A%22x%22%3Bdisplay%3Ablock%3Bline-height%3A1%3Bpadding%3A.2rem%20.4rem%3Bposition%3Aabsolute%3Bright%3A-.4rem%3Btop%3A-.4rem%3B%7D.info-box%20p%7Bmargin%3A0%3B%7D.hidden%7Bopacity%3A0%3B%7D%40-webkit-keyframes%20slide-down%7Bfrom%7B-webkit-transform%3AtranslateY%28-4rem%29%7Dto%7B-webkit-transform%3AtranslateY%280%29%7D%7D%40keyframes%20slide-down%7Bfrom%7Btransform%3AtranslateY%28-4rem%29%7Dto%7Btransform%3AtranslateY%280%29%7D%7D%2F%2A%20content------------------------%20%2A%2F.content%7Bmargin%3A0%20auto%3Bmax-width%3A47.5em%3B%7D%2F%2A%20table-titre------------------------%20%2A%2F.table-titre%20span%7Bdisplay%3Ablock%3Bfont-weight%3Abold%3Bmargin%3A1em%200%20.5em%200%3B%7D.table-titre%20br%7Bmargin%3A0%3B%7D.table-titre%20.pdf%7Bmargin-top%3A1em%3B%7D%2F%2A%20table-modification------------------------%20%2A%2F.table-modification%20br%7Bmargin%3A0%3B%7D.table-modification%20tr%2Btr%7Bborder-top%3A1px%20dotted%20%23ccc%3Bdisplay%3Ablock%3Bpadding%3A.5em%200%3Btext-transform%3Alowercase%3B%7D.table-modification%20tr%3Anth-of-type%283%29%7Bborder-top%3Anone%3Bmargin-top%3A0%3Bpadding-top%3A0%3B%7D.table-modification%20tr%3Alast-of-type%7Bpadding-bottom%3A0%3B%7D.table-modification%20.pdf%7Bdisplay%3Ainline-block%3Bmargin-right%3A1.5rem%3B%7D.table-modification%20.pdf%2Bli%7Bmax-width%3Acalc%28100%25%20-%201.5rem%20-%20152px%29%3B%7D.table-modification%20li%7Bdisplay%3Ainline-block%3Blist-style-type%3Anone%3Bvertical-align%3Atop%3B%7D.table-modification%20li%20span%7Bcolor%3A%237f7f7f%3B%7D%2F%2A%20table-texte------------------------%20%2A%2F.title%2C.article%2C.chapter%2C.section%2C.subsection%7Bcolor%3A%23000%3Bdisplay%3Ablock%3Bfont-family%3AGeorgia%2Cserif%3Bline-height%3A1.2%3Bmargin%3A1.5rem%200%3B%7D.article%7Bborder%3A1px%20solid%20%23ccc%3Bfont-size%3A1.3em%3Bline-height%3A1.4%3Bmargin%3A1.5rem%200%201rem%200%3Bpadding%3A.2em%20.5em%3B%7D.chapter%7Bfont-size%3A1.8em%3Bfont-weight%3Anormal%3B%7D.title%7Bbackground%3A%23efefef%3Bfont-size%3A1.5em%3Bpadding%3A.2em%20.5em%3B%7Dtd%20.title%3Afirst-child%2Ctd%20.chapter%3Afirst-child%7Bmargin-top%3A0%3B%7D.section%7Bcolor%3A%23b96060%3Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3Bfont-size%3A1.5em%3B%7D.subsection%7Bfont-weight%3Abold%3B%7D%2F%2A%20quirks------------------------%20%2A%2F.table-hit0%2C.table-end%2Ctable%20%3E%20br%3Afirst-child%2Ctd%20%3E%20br%3Afirst-child%2Ctd%20%3E%20br%3Alast-child%2Ctr%20%3E%20br%3Afirst-child%2Ctr%20%3E%20br%3Alast-child%2C.title%2Bbr%2C.chapter%2Bbr%2C.section%2Bbr%2C.subsection%2Bbr%2C%5Bclass%5E%3Dtable%5D%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%2Btd%2C.table-modification%20tr%3Anth-of-type%282%29%7Bdisplay%3Anone%3B%7D%2F%2A%20dark------------------------%20%2A%2F.dark%7Bbackground%3A%23212324%3Bcolor%3A%23ddd%3B%7D.dark%20a%7Bcolor%3A%23b96060%3B%7D%2F%2A%20nav-sidebar%20%2A%2F.dark%20.sidebar%7Bbackground%3A%231b1d1e%3Bborder-right-color%3A%23151617%3Bcolor%3A%23ddd%3B%7D.dark%20.sidebar%20%2A%7Bborder-color%3A%23151617%3B%7D.dark%20.sidebar%20%3E%20ul%20ul%7Bbackground%3Argba%28255%2C255%2C255%2C.05%29%3B%7D%2F%2A%20table-titre%20%2A%2F.dark%20.table-titre%20.pdf%3Ahover%2C.dark%20.table-titre%20.pdf%3Afocus%2C.dark%20.table-modification%20a%3Ahover%2C.dark%20.table-modification%20a%3Afocus%7Bbackground-position%3A0%20-216px%3Bcolor%3A%23b96060%3Btext-decoration%3Anone%3B%7D%2F%2A%20table-texte%20%2A%2F.dark%20.title%2C.dark%20.article%2C.dark%20.chapter%2C.dark%20.section%2C.dark%20.subsection%7Bcolor%3A%23fff%3B%7D.dark%20.article%7Bborder-color%3A%23333%3B%7D.dark%20.title%7Bbackground%3A%23333%3B%7D.dark%20.section%7Bcolor%3A%23b96060%3B%7D%2F%2A%20table-modification%20%2A%2F.dark%20.table-modification%20tr%2Btr%7Bborder-top-color%3A%23333%3B%7D%2F%2A%20sans-serif------------------------%20%2A%2F.sans-serif%7Bfont-family%3ALucida%20Grande%2CLucida%20Sans%2CLucida%20Sans%20Unicode%2Csans-serif%3B%7D%2F%2A%20media%20queries------------------------%20%2A%2F%40media%20handheld%2C%28max-width%3A1000px%29%7Bbody%7Bmargin%3A0%201.5rem%3B%7D%7D%40media%20print%7B%2A%2C%2A%3Abefore%2C%2A%3Aafter%7Bbackground%3Atransparent%20%21important%3Bcolor%3A%23000%20%21important%3Bbox-shadow%3Anone%20%21important%3Btext-shadow%3Anone%20%21important%3B%7Dbody%2Ctd%7Bfont-size%3A10pt%3B%7D.pdf%7Bdisplay%3Ablock%3Bwidth%3Aauto%3Bheight%3Aauto%3Bpadding%3A0%3Bfont%3Ainherit%3Btext-transform%3Alowercase%3B%7D.pdf%3Abefore%7Bcontent%3A%22%28%22%3B%7D.pdf%3Aafter%7Bcontent%3A%22%29%5C%20%22%20attr%28href%29%3B%7D.info-box%7Bdisplay%3Anone%3B%7D.title%2C.article%2C.chapter%2C.section%2C.subsection%7Bpage-break-after%3Aavoid%3B%7D.article%7Bfont-size%3A1em%3B%7D.chapter%7Bfont-size%3A1.5em%3B%7D.title%7Bfont-size%3A1.3em%3B%7D%7D%27%3B%0A%2F%2A%2A%2A%20Checkifthe%20document%20has%20already%20been%20parsed.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isAlreadyParsed%28%29%7Breturn%20%21%21%28d.getElementsByClassName%28%27better-lex%27%29%5B0%5D%29%3B%7D%2F%2A%2A%2A%20Try%20to%20detect%20the%20language%20of%20the%20document.%2A%20If%20none%20is%20found%2Creturn%20the%20value%20of%20the%2A%20global%20%60bookmarkletLang%60%20variable.%2A%2A%20%40param%7Bstring%7Durl%2A%20%40return%7Bstring%7D%2A%2Ffunction%20detectLang%28url%29%7Bvar%20lang%3Durl.match%28%2Flanguage%3D%28nl%7Cfr%29%2Fi%29%3Bif%28lang%29return%20lang%5B1%5D%3Breturn%20bookmarkletLang%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20Better%20Lex%20website.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnBetterLex%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20page%20of%20a%20document.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnDocument%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a1.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20document%20is%20contained%20inside%20a%20frame.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnFrame%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20page%20is%20viewed%20locally.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnLocal%28%29%7Breturn%20%21%21%28url.match%28%2F%5E%28file%7Chttp%3A%5C%2F%5C%2F%28127%7Clocalhost%29%29%2Fi%29%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20the%20eJustel%20search%20page.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnSearch%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_rech.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Checkifthe%20person%20is%20on%20a%20translation%20page.%2A%2A%20%40return%7BBoolean%7D%2A%2Ffunction%20isOnTranslation%28%29%7Bvar%20needle%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Fchange_lg.pl%27%3Breturn%28url.lastIndexOf%28needle%2C0%29%3D%3D%3D%200%29%3B%7D%2F%2A%2A%2A%20Build%20a%20new%20URL%20from%20an%20URL%20and%2Coptionally%2Ca%20language%20code.%2A%2A%20%40param%7Bstring%7Durl%2A%20%40param%7Bstring%7Dtrans%2A%20%40return%7Bstring%7D%2A%2Ffunction%20reconstructURL%28url%2Ctrans%29%7Bvar%20cn%3Durl.match%28%2Fcn%3D%28%5B%5E%26%5D%2B%29%2Fi%29%2Clang%3Dtrans%20%3F%20trans%3AdetectLang%28url%29%2Cfromtab%3D%28lang%20%3D%3D%3D%20%27fr%27%29%3F%20%27loi%27%3A%27wet%27%3Bvar%20target%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_a1.pl%3Fcaller%3Dlist%27%2B%27%26cn%3D%27%2Bcn%5B1%5D%2B%27%26language%3D%27%2Blang%2B%27%26fromtab%3D%27%2Bfromtab%3Breturn%20target%3B%7D%2F%2A%2A%2A%20Remove%20all%20the%20attributes%20of%20an%20HTML%20element.%2A%2A%20%40param%7BHTMLElement%7Delement%2A%20%40return%7Bvoid%7D%2A%2Ffunction%20removeAllAttrs%28element%29%7Bfor%28var%20i%3Delement.attributes.length%3B%20i--%20%3E%200%3B%29%7Belement.removeAttribute%28element.attributes%5Bi%5D%29%3B%7D%7D%0A%2F%2AThe%20following%20variables%20are%20created%20by%20the%20build%20script%3A-%20%22window._translations%22%20based%20upon%20the%20content%20of%20%22src%2Ftranslations.json%22-%20%22css%22%20based%20upon%20the%20content%20of%20%22src%2Fmain.css%22-%20%22bookmarkletLang%22%20equals%20either%20%22fr%22%20or%20%22nl%22%2A%2Fvar%20version%3D%271.0%27%3Bvar%20d%3Ddocument%2Cb%3Dd.body%2Cw%3Dwindow%3Bvar%20url%3Dd.location.href%3Bvar%20lang%3DdetectLang%28url%29%3Bvar%20alternateLang%3D%28lang%20%3D%3D%3D%20%27fr%27%29%3F%20%27nl%27%3A%27fr%27%3Bvar%20trans%3Dw._translations%5Blang%5D%3Bif%28%28isOnDocument%28%29%7C%7CisOnLocal%28%29%29%26%26%21isAlreadyParsed%28%29%29%7Bvar%20stylesheet%3Dd.createElement%28%27style%27%29%3Bstylesheet.innerHTML%3Dcss%3Bd.head.appendChild%28stylesheet%29%3BremoveAllAttrs%28b%29%3B%2F%2A1.%20%20Markup%20homogenization2.%20%20New%20lines%20are%20removed%20to%20ease%20later%20parsing3.%20%20%3Cb%3E%2C%3Cfont%3E%20and%20%3Cspan%3E%20are%20removed4%20%20%20%3Ca%3E%20linking%20to%20%22%23t%22%20or%20having%20a%20title%20are%20deleted.%20Typically%20usedfor%20reference%20to%20footnote%2Cuseless%20and%20would%20complexify%20the%20parsing5.%20%20Empty%20%3Ctd%3E%20or%20%3Ctr%3E%20elements%20are%20removed6.%20%20Identifiers%20and%20classes%20are%20added%20to%20every%20table%20according%20to%20thevalue%20of%20the%20preceding%20hidden%20%3Ca%3E%20anchor7.%20%20Any%28misused%29%3Cth%3E%20is%20replaced%20by%20a%20%3Ctd%3E8.%20%20Typographic%20improvements%2A%2Fb.innerHTML%3Db.innerHTML.replace%28%2F%28%3F%3A%3C%5C%2F%3Fbr%5C%2F%3F%3E%5Cs%3F%29%2B%2Fgi%2C%27%3Cbr%3E%27%29.replace%28%2F%5B%5Cn%7C%5Cr%5D%2Fgi%2C%27%27%29.replace%28%2F%3C%5C%2F%3Fb%3E%2Fgi%2C%27%27%29.replace%28%2F%3C%5C%2F%3F%28%3F%3Afont%7Cspan%29%5B%5E%3E%5D%2A%3F%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ca%28%3F%3A%20%28%3F%3Ahref%3D%22%23t%22%7Ctitle%3D%22%5B%5E%22%5D%2B%22%29%29%2B%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Fa%3E%2Fgi%2C%27%241%27%29.replace%28%2F%3Ctd%5B%5E%3E%5D%2A%3F%3E%5Cs%2A%3F%3C%5C%2Ftd%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ctr%5B%5E%3E%5D%2A%3F%3E%5Cs%2A%3F%3C%5C%2Ftr%3E%2Fgi%2C%27%27%29.replace%28%2F%3Ca%20name%3D%22%28%5B%5E%22%5D%2B%29%22%3E%5B%5E%3E%5D%2A%3F%3C%5C%2Fa%3E%28%3F%3A%3Cbr%3E%7C%5Cs%29%2A%3Ctable%5B%5E%3E%5D%2B%3E%2Fgi%2C%27%3Ctable%20id%3D%22%241%22%20class%3D%22table-%241%22%3E%27%29.replace%28%2F%3C%28%5C%2F%3F%29th%5B%5E%3E%5D%2A%3F%3E%2Fgi%2C%27%3C%241td%3E%27%29.replace%28%2FCHAPITRE%2Fg%2C%27Chapitre%27%29.replace%28%2FHOOFDSTUK%2Fg%2C%27Hoofdstuk%27%29.replace%28%2FTITRE%2Fg%2C%27Titre%27%29.replace%28%2FTITEL%2Fg%2C%27Titel%27%29.replace%28%2FANNEXES%2Fg%2C%27Annexes%27%29.replace%28%2FBIJLAGEN%2Fg%2C%27Bijlagen%27%29.replace%28%2FANNEXE%2Fg%2C%27Annexe%27%29.replace%28%2FBIJLAGE%2Fg%2C%27Bijlage%27%29%3Bb.innerHTML%3D%27%3Cdiv%20class%3D%22wrapper%20better-lex%22%3E%3Cdiv%20class%3D%22content%22%3E%27%2Bb.innerHTML%2B%27%3C%2Fdiv%3E%3C%2Fdiv%3E%27%3Bvar%20headingsTable%3Db.getElementsByClassName%28%27table-titre%27%29%5B0%5D%3B%2F%2A1.%20%20Titles%20are%20wrapped%20in%20%3Cspan%3E%20elements2.%20%20In%20cases%20where%20various%20values%20are%20provided%20and%20separated%20by%20%22%2A%22%2C%22%2A%22%20is%20replaced%20by%20%3Cbr%3E3.%20%20%22pdf%22%20class%20is%20added%20to%20link%20pointing%20to%20an%20%22image%22%2Cwordingis%20fixed%2CURL%20is%20fixed%20as%20well%2A%2FheadingsTable.innerHTML%3DheadingsTable.innerHTML.replace%28%2F%3Cbr%3E%5B%5E%5C%28%5D%28%5B%5E%3A%5D%2B%20%3A%29%2Fg%2C%27%3Cspan%3E%241%3C%2Fspan%3E%27%29.replace%28%2F%28%3F%3A%26nbsp%3B%7C%20%29%2B%5B%5C%2A%5D%2B%28%3F%3A%26nbsp%3B%7C%20%29%2B%2Fg%2C%27%3Cbr%3E%27%29.replace%28%2F%3Ca%5B%5E%3E%5D%2Bhref%3D%22%5B%5E%22%5D%2Bpdf_file%3D%28%5B%5E%22%5D%2B%5C.pdf%29%22%5B%5E%3E%5D%2B%3E%28%3F%3Aimage%7Cbeeld%29%3C%5C%2Fa%3E%2Fgi%2C%27%3Ca%20href%3D%22%241%22%20class%3D%22pdf%22%3Epdf%3C%2Fa%3E%27%29%3Bvar%20textTable%3Db.getElementsByClassName%28%27table-texte%27%29%5B0%5D%3BtextTable.innerHTML%3DtextTable.innerHTML.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%3Ca%20name%3D%22%28Art%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%5B%5E%3C%5D%2B%3C%5C%2Fa%3E%28%3F%3A%20%3F%3Ca%5B%5E%3E%5D%2B%3E%5B%5E%3E%5D%2B%3E%5B.%20%5D%2B%7C%20%3F%5B%5E%20%5D%2B%20%3F%29%28%3F%3A%3Cbr%3E%29%2A%2Fgi%2C%27%3Ca%20class%3D%22article%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%241%3C%2Fa%3E%26nbsp%3B%26nbsp%3B%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Achapitre%7Choofdstuk%7Cannexes%3F%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22chapter%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Atitre%7Ctitel%29.%2A%3F%29%3C%5C%2Fa%3E%28%5B%5E%3C%5D%2B%29%29%2Fgi%2C%27%3Ca%20class%3D%22title%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Asection%7Cafdeling%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22section%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29.replace%28%2F%28%3F%3A%3Cbr%3E%29%2A%28%3F%3A%20%7C%26nbsp%3B%29%2A%28%3F%3A%3Ca%20name%3D%22%28LN%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3E%28%28%3F%3Asous-section%7Conderafdeling%29.%2A%3F%29%3C%5C%2Fa%3E%28.%2A%3F%29%29%28%3F%3A%3Cbr%3E%7C%28%3Ca%20class%29%29%2Fgi%2C%27%3Ca%20class%3D%22subsection%22%20href%3D%22%23%241%22%20name%3D%22%241%22%3E%242%243%3C%2Fa%3E%244%27%29%3Bvar%20modificationTable%3Db.getElementsByClassName%28%27table-modification%27%29%5B0%5D%3B%2F%2A1.%20%20%22pdf%22%20class%20is%20added%20to%20link%20pointing%20to%20an%20%22image%22%2Cwordingis%20fixed%2CURL%20is%20fixed%20as%20well2.%20%20Modification%20details%20are%20wrapped%20in%20%3Cspan%3E%2A%2Fif%28modificationTable%29%7BmodificationTable.innerHTML%3DmodificationTable.innerHTML.replace%28%2F%3Ca%5B%5E%3E%5D%2Bhref%3D%22%5B%5E%22%5D%2Bpdf_file%3D%28%5B%5E%22%5D%2B%5C.pdf%29%22%5B%5E%3E%5D%2B%3E%28%3F%3Aimage%7Cbeeld%29%3C%5C%2Fa%3E%2Fgi%2C%27%3Ca%20href%3D%22%241%22%20class%3D%22pdf%22%3Epdf%3C%2Fa%3E%27%29.replace%28%2F%3Cbr%3E%28.%2A%3F%29%3C%5C%2Fli%3E%2Fgi%2C%27%3Cbr%3E%3Cspan%3E%241%3C%2Fspan%3E%3C%2Fli%3E%27%29%3B%7Dvar%20sidebar%3Dd.createElement%28%27div%27%29%3Bsidebar.setAttribute%28%27class%27%2C%27sidebar%27%29%3Bvar%20mainTables%3D%5B%5D.slice.call%28d.querySelectorAll%28%27%5Bclass%5E%3Dtable%5D%27%29%29%3Bvar%20uselessTablesIds%3D%5B%27hit0%27%2C%27end%27%5D%3Bvar%20toc%3D%5B%5D%3BmainTables.forEach%28function%28item%29%7Bif%28uselessTablesIds.indexOf%28item.id%29%3D%3D%3D%20-1%29%7Bvar%20selector%3D%27%23%27%2Bitem.id%2B%27%20%3E%20tbody%20%3E%20tr%3Afirst-child%20%3E%20td%3Afirst-child%27%3Bvar%20li%3D%27%3Cli%3E%3Ca%20href%3D%22%23%27%2Bitem.id%2B%27%22%3E%27%2Bd.querySelector%28selector%29.innerHTML%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%3Btoc.push%28li%29%3B%7D%20%7D%29%3Bsidebar.innerHTML%3D%27%3Cp%20class%3D%22logo%22%3E%3Ca%20href%3D%22%23%22%3EBetter%20Lex%3C%2Fa%3E%3C%2Fp%3E%27%2B%27%3Cul%3E%27%2B%27%20%20%20%3Cli%3E%3Ca%20href%3D%22%27%2Burl%2B%27%22%20target%3D%22_blank%22%3E%27%2Btrans.source%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Ca%20href%3D%22%27%2BreconstructURL%28url%2CalternateLang%29%2B%27%22%20class%3D%22trans%22%3E%27%2Btrans.trans%2B%27%3C%2Fa%3E%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.nav%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2Btoc.join%28%27%27%29%2B%27%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.display%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22theme%22%20id%3D%22dark%22%20%2F%3E%3Clabel%20for%3D%22dark%22%3E%27%20%2B%20trans.dark%20%2B%20%27%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22theme%22%20id%3D%22light%22%20checked%3D%22checked%22%20%2F%3E%3Clabel%20for%3D%22light%22%3E%27%20%2B%20trans.light%20%2B%20%27%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%20%20%20%3Cli%3E%3Cspan%20class%3D%22o%22%3E%27%2Btrans.font%2B%27%3C%2Fspan%3E%27%2B%27%20%20%20%20%20%20%20%3Cul%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22font%22%20id%3D%22serif%22%20checked%3D%22checked%22%20%2F%3E%3Clabel%20for%3D%22serif%22%3ESerif%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%3Cinput%20type%3D%22radio%22%20name%3D%22font%22%20id%3D%22sans-serif%22%20%2F%3E%3Clabel%20for%3D%22sans-serif%22%3ESans-serif%3C%2Flabel%3E%3C%2Fli%3E%27%2B%27%20%20%20%20%20%20%20%3C%2Ful%3E%27%2B%27%20%20%20%3C%2Fli%3E%27%2B%27%3C%2Ful%3E%27%2B%27%3Cp%20class%3D%22footer%22%3E%3Ca%20title%3D%22Source%20code%20on%20GitHub%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fnurpa%2Fbetter-lex%2F%22%3EBetter%20Lex%3C%2Fa%3E%20version%20%27%2Bversion%2B%27%3C%2Fp%3E%27%2B%27%3Cp%20class%3D%22footer%20update%22%3E%3Ca%20href%3D%22http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%3Fversion%3D%27%2Bversion%2B%27%26lang%3D%27%2Blang%2B%27%22%3E%27%2Btrans.update%2B%27%3C%2Fa%3E%3C%2Fp%3E%27%3Bb.insertBefore%28sidebar%2Cb.firstChild%29%3Bd.getElementById%28%27dark%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.add%28%27dark%27%29%3B%7D%29%3Bd.getElementById%28%27light%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.remove%28%27dark%27%29%3B%7D%29%3Bd.getElementById%28%27serif%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.remove%28%27sans-serif%27%29%3B%7D%29%3Bd.getElementById%28%27sans-serif%27%29.addEventListener%28%27click%27%2Cfunction%28%29%7Bb.classList.add%28%27sans-serif%27%29%3B%7D%29%3Bvar%20infoBox%3Dd.createElement%28%27div%27%29%3BinfoBox.setAttribute%28%27class%27%2C%27info-box%20sans-serif%27%29%3BinfoBox.innerHTML%3D%27%3Cp%3E%27%2Btrans.infoBox%2B%27%3C%2Fp%3E%27%3Bb.appendChild%28infoBox%29%3B%2F%2AHide%20the%20info%20box%3A-%20when%20the%20sidebar%20is%20opened-%20when%20the%20info%20box%20is%20clicked%20upon-%20after%207%20seconds%2A%2Fsidebar.addEventListener%28%27mouseover%27%2Cfunction%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%29%3BinfoBox.addEventListener%28%27click%27%2Cfunction%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%29%3Bw.setTimeout%28function%28%29%7BinfoBox.classList.add%28%27hidden%27%29%3B%7D%2C7000%29%3BinfoBox.addEventListener%28%27transitionend%27%2Cfunction%28%29%7BinfoBox.style.display%3D%27none%27%3B%7D%29%3B%7Delse%20if%28isOnBetterLex%28%29%29%7Bd.location%3D%27http%3A%2F%2Fnurpa.be%2Fbetter-lex%2F%3Fversion%3D%27%2Bversion%2B%27%26lang%3D%27%2Blang%3B%7Delse%20if%28isOnFrame%28%29%29%7Balert%28trans.alertFrame%29%3Bvar%20oldUrl%3Ddocument.getElementsByTagName%28%27frame%27%29%5B0%5D.getAttribute%28%27src%27%29%3Bd.location%3DreconstructURL%28oldUrl%29%3B%7Delse%20if%28isOnTranslation%28%29%29%7Balert%28trans.alertTrans%29%3Bd.location%3DreconstructURL%28url%29%3B%7Delse%20if%28isOnSearch%28%29%7C%7CisAlreadyParsed%28%29%29%7B%7Delse%7Balert%28trans.alertDefault%29%3Bd.location%3D%27http%3A%2F%2Fwww.ejustice.just.fgov.be%2Fcgi_loi%2Floi_rech.pl%3Flanguage%3D%27%2BbookmarkletLang%3B%7D})(); \ No newline at end of file diff --git a/lib/.placeholder b/lib/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..0fc0674 --- /dev/null +++ b/scripts/build @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + + +# Execute the script from the right location + +source="${BASH_SOURCE}" + +while [ -h "$source" ]; do + source="$(readlink $source)" +done + +cd "$(dirname $source)" + + +# Resources + +bin="../bin/" +src="../src/" + +css="${src}main.css" +main="${src}main.js" +trans="${src}translations.json" +utils="${src}utility.js" + + +# Where the magic happens + +for bookmarkletLang in "nl" "fr"; do + + tmpCSS=$(mktemp -t "blex_css.js.XXXXXXXXXX") + tmpTrans=$(mktemp -t "blex_trans.js.XXXXXXXXXX") + timestamp=$(date +"%Y-%m-%d_%Hh%M") + + ## Generate temporary files containing JS vars + + ### CSS (minified) + + if [ -f "$tmpCSS" ]; then + echo "var css = '$(cat $css)';" > "$tmpCSS" + else + echo "betterlex: unable to create temporary file $tmpCSS" + exit + fi + + ### Translations + + if [ -f "$tmpTrans" ]; then + echo "var bookmarkletLang = '$bookmarkletLang'; window._translations = $(cat $trans);" > "$tmpTrans" + else + echo "betterlex: unable to create temporary file $tmpTrans" + exit + fi + + ## Generate the bookmarklet + + ../lib/spotch/bin/spotch make "$tmpTrans" "$tmpCSS" "$utils" "$main" --output "${bin}bookmarklet_${bookmarkletLang}_${timestamp}.js" --no-minify "$tmpTrans" +done diff --git a/scripts/install b/scripts/install new file mode 100755 index 0000000..aaab828 --- /dev/null +++ b/scripts/install @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + + +# Execute the script from the right location + +source="${BASH_SOURCE}" + +while [ -h "$source" ]; do + source="$(readlink $source)" +done + +cd "$(dirname $source)" + + +# Utility functions + +function is_installed() +{ + command -v "$1" >/dev/null 2>&1 +} + +function status() +{ + echo + echo "betterlex: $1" + echo +} + + +# Move to the "lib" directory + +cd ../lib + + +# Create directories + +for dir in "composer" "spotch"; do + if [ ! -d "$dir" ]; then + mkdir "$dir" + fi +done + + +# Install dependencies + +## Check if PHP is installed + +if ! is_installed php; then + status "please install PHP before continuing." + exit +fi + +## Install Composer + +if [ ! -e "composer/composer.phar" ]; then + status "installing Composer..." + + php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=composer +fi + +## Install Spotch + +if [ ! -e "spotch/bin/spotch" ]; then + status "installing Spotch..." + + git clone "https://github.com/miclf/spotch.git" "spotch" + (cd spotch && ../composer/composer.phar update) + chmod +x "spotch/bin/spotch" +fi diff --git a/src/main.css b/src/main.css new file mode 100644 index 0000000..fe16e04 --- /dev/null +++ b/src/main.css @@ -0,0 +1,458 @@ +* { + background: none; + border: none; + color: inherit; + font: inherit; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + background: #f8f8f8; + color: #302c22; + font-family: Georgia, serif; + line-height: 1.4; + margin: 0; + transition: background, color .2s; +} +body, td { + font-size: 16px; +} +a { + background: transparent; + color: #2455c3; + text-decoration: none; +} +a:hover, a:focus { + text-decoration: underline; +} +br { + margin-bottom: 1em; +} +input { + line-height: normal; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +[class^=table] { + margin-top: 5em; + width: 100%; +} +[class^=table] table { + width: 100%; +} +.pdf { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAFECAYAAADbSffBAAAEk0lEQVR42u3dMXLTUBSG0WvGHevwCtRSswQPJSntTYSULIC4YujZAdQu81bADtgApSgQ4AQgMXk/DuicjiLKjOabqyflIS2urq4uq2pT8MWuqrb3PcgwDFVVtayqzTAMC+eV1tr4ddgMw7DtccxHTis3LKpq01q7FBgR0xWtS2QCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikQmMaGQCIxqZwIhGJjCikS2dEhKRtdbG1prA+MHYWut1rI3AuHl566a1NlqDESUwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbA4Faz2zI9var7ZOb2yngTDIEhMLAGm/hsjgmGwEBgWIP9feOJf7/nYCAwBAaeg2GCITAQGNZgf4PnYCYYAgOBYQ1mDWSCgcBwifwfDMPgJAjst+77HMwaziUSgSEwsAY7fpFuDWWCITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDH5rWVW71troVBCwWz57+clp4FoUVbW970E+vH3ybYJtPrx94uME1Gq9H6tqM/1z2+OY1mDcnDyLKbJLgfHgI/NBUn5lUd+/rbkVGA8yMoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0MoERjUxgRCMTGNHIBEY0Mtt1SES2Wa33lyYY0Um2Wu8FxnXTtuleNgLjm97/N2O13o/WYEQJDIEhMBAYAkNgIDAEhsBAYAgMgYHAEBgIDIEhMLjV7LZMd95zfrS5vTLeBENgCAwEhsBwFzkrd7nj8ylEEwyBITAQGAJDYNCFxxSTm3+EXq33d/3Rnz3K8OjCBLuu4y4LcQksFpm4BBaLTFwCi0UmLoHFJpK4BBaLTFwCi0UmLoHFIhOXwGKRiUtgJ1/4IzAEhsBAYJzM7LbrzO3dECYYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAEBgJDYCAwBIbAQGAIDIGBwBAYAgOBITAQGAJDYCAwBIbA4HjLqtp1/CA6HNotXz1+/dF54MBFVb14+uZNl4Mt3j1/PlbVotcB+Xe9Pzsbe0dmDcYPQ6eqzqvqxfuzsz6BmV58NbXQLTITjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEJjGhkAiMamcCIRiYwopEtnRIOHWyb7uFcYBxOn0XvWF0iiRIYAkNgIDAEhsBAYAgMgYHAEBgCA4EhMBAYAkNgcKvZbZnuvOf8aL23JZtguESCwBAYCAx3kQ/FXe74Tn1XaoIhMBAYAgOBITD+Hx5TTP70j9A/+zmPLkywSkUhLoHF4hCXwGKRiEtgsVjEJbBYZOISWCwycQksFpm4BBaLTFwCi0UmLoE9mLtLBIbAEBgIjFOY3Xadub0bwgRDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBIbAQGAIDASGwBAYCAyBITAQGAJDYCAwBAYCQ2AIDASGwBAYHG9ZVRe+wUPIxWfpNV1bZbmCywAAAABJRU5ErkJggg==) top left no-repeat; + display: block; + font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, sans-serif; + font-size: 16px; + height: 108px; + padding: 4.8em 0 0 .8em; + width: 152px; +} +.pdf:hover, +.pdf:focus { + background-position: 0 -108px; + color: #2455c3; + text-decoration: none; +} + +/* headings */ + +[class^=table] > tbody > tr:first-child > td:first-child { + display: block; + font-family: Georgia, serif; + font-size: 1.8em; + padding-bottom: 2em; + text-align: center; + text-transform: uppercase; + width: 100%; +} + +/* sidebar +------------------------ */ + +.sidebar { + background: #ebebeb; + border-right: 1px solid #e6e6e6; + color: #302c22; + display: inline-block; + height: 100%; + left: 0; + margin-left: -13rem; + opacity: 0; + overflow: auto; + position: fixed; + top: 0; + transition: margin .3s; + width: 16rem; + z-index: 100; +} +.sidebar:hover { + margin-left: 0; + opacity: 1; +} +.sidebar * { + font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, sans-serif; +} +.logo { + margin: 0; +} +.logo a { + display: block; + font-size: 1.4em; + font-weight: bold; + line-height: 1; + padding: 1.5rem; + text-decoration: none; +} +.logo, +.sidebar > ul { + border-bottom: 1px solid #e6e6e6; +} +.sidebar ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.sidebar > ul ul { + background: rgba(255, 255, 255, .6); + border-top: 1px dotted #e6e6e6; + padding: 1rem 1.5rem; +} +.sidebar > ul ul a { + display: inline-block; + width: 100%; +} +.sidebar > ul > li > a, +.sidebar .o { + display: block; + padding: .5rem 1.5rem; +} +.sidebar > ul > li + li { + border-top: 1px solid #e6e6e6; +} +.sidebar label { + cursor: pointer; +} +.sidebar label[for=serif] { + font-family: Georgia, serif; +} +.sidebar input[type=radio] { + margin-right: .5rem; + vertical-align: baseline; +} +.sidebar .footer { + font-size: .8em; + padding: 0 1.5rem; +} +.sidebar .update { + margin-top: 2rem; + text-align: center; +} +.sidebar .update a { + display: inline-block; + padding: .5em 1em; +} + +/* info-box +------------------------ */ + +.info-box { + -webkit-animation: slide-down .6s; + animation: slide-down .6s; + background: #d8ecf5; + border: 1px solid #aed7ea; + border-radius: 3px; + color: #5694b1; + cursor: pointer; + left: 1rem; + max-width: 75%; + padding: .5rem 1rem; + position: fixed; + top: 1rem; + transition: opacity 1s; +} +.info-box:after { + background: #5694b1; + border-radius: 3px; + color: #fff; + content: "x"; + display: block; + line-height: 1; + padding: .2rem .4rem; + position: absolute; + right: -.4rem; + top: -.4rem; +} +.info-box p { + margin: 0; +} +.hidden { + opacity: 0; +} +@-webkit-keyframes slide-down { + from {-webkit-transform: translateY(-4rem)} + to {-webkit-transform: translateY(0)} +} +@keyframes slide-down { + from {transform: translateY(-4rem)} + to {transform: translateY(0)} +} + +/* content +------------------------ */ + +.content { + margin: 0 auto; + max-width: 47.5em; +} + +/* table-titre +------------------------ */ + +.table-titre span { + display: block; + font-weight: bold; + margin: 1em 0 .5em 0; +} +.table-titre br { + margin: 0; +} +.table-titre .pdf { + margin-top: 1em; +} + +/* table-modification +------------------------ */ + +.table-modification br { + margin: 0; +} +.table-modification tr + tr { + border-top: 1px dotted #ccc; + display: block; + padding: .5em 0; + text-transform: lowercase; +} +.table-modification tr:nth-of-type(3) { + border-top: none; + margin-top: 0; + padding-top: 0; +} +.table-modification tr:last-of-type { + padding-bottom: 0; +} +.table-modification .pdf { + display: inline-block; + margin-right: 1.5rem; +} +.table-modification .pdf + li { + max-width: calc(100% - 1.5rem - 152px); +} +.table-modification li { + display: inline-block; + list-style-type: none; + vertical-align: top; +} +.table-modification li span { + color: #7f7f7f; +} + +/* table-texte +------------------------ */ + +.title, +.article, +.chapter, +.section, +.subsection { + color: #000; + display: block; + font-family: Georgia, serif; + line-height: 1.2; + margin: 1.5rem 0; +} +.article { + border: 1px solid #ccc; + font-size: 1.3em; + line-height: 1.4; + margin: 1.5rem 0 1rem 0; + padding: .2em .5em; +} +.chapter { + font-size: 1.8em; + font-weight: normal; +} +.title { + background: #efefef; + font-size: 1.5em; + padding: .2em .5em; +} +td .title:first-child, +td .chapter:first-child { + margin-top: 0; +} +.section { + color: #b96060; + font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, sans-serif; + font-size: 1.5em; +} +.subsection { + font-weight: bold; +} + +/* quirks +------------------------ */ + +.table-hit0, +.table-end, +table > br:first-child, +td > br:first-child, +td > br:last-child, +tr > br:first-child, +tr > br:last-child, +.title + br, +.chapter + br, +.section + br, +.subsection + br, +[class^=table] > tbody > tr:first-child > td + td, +.table-modification tr:nth-of-type(2) { + display: none; +} + +/* dark +------------------------ */ + +.dark { + background: #212324; + color: #ddd; +} +.dark a { + color: #b96060; +} + +/* nav-sidebar */ + +.dark .sidebar { + background: #1b1d1e; + border-right-color: #151617; + color: #ddd; +} +.dark .sidebar * { + border-color: #151617; +} +.dark .sidebar > ul ul { + background: rgba(255, 255, 255, .05); +} + +/* table-titre */ + +.dark .table-titre .pdf:hover, +.dark .table-titre .pdf:focus, +.dark .table-modification a:hover, +.dark .table-modification a:focus { + background-position: 0 -216px; + color: #b96060; + text-decoration: none; +} + +/* table-texte */ + +.dark .title, +.dark .article, +.dark .chapter, +.dark .section, +.dark .subsection { + color: #fff; +} +.dark .article { + border-color: #333; +} +.dark .title { + background: #333; +} +.dark .section { + color: #b96060; +} + +/* table-modification */ + +.dark .table-modification tr + tr { + border-top-color: #333; +} + +/* sans-serif +------------------------ */ + +.sans-serif { + font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, sans-serif; +} + +/* media queries +------------------------ */ + +@media handheld, (max-width: 1000px) { + body { + margin: 0 1.5rem; + } +} +@media print { + *, *:before, *:after { + background: transparent !important; + color: #000 !important; + box-shadow: none !important; + text-shadow: none !important; + } + body, td { + font-size: 10pt; + } + .pdf { + display: block; + width: auto; + height: auto; + padding: 0; + font: inherit; + text-transform: lowercase; + } + .pdf:before { + content: "("; + } + .pdf:after { + content: ")\ " attr(href); + } + .info-box { + display: none; + } + .title, + .article, + .chapter, + .section, + .subsection { + page-break-after: avoid; + } + .article { + font-size: 1em; + } + .chapter { + font-size: 1.5em; + } + .title { + font-size: 1.3em; + } +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..2fa1538 --- /dev/null +++ b/src/main.js @@ -0,0 +1,349 @@ +// ---------------------------------------- +// Main variables. +// ---------------------------------------- + +/* + The following variables are created by the build script: + + - "window._translations" based upon the content of "src/translations.json" + - "css" based upon the content of "src/main.css" + - "bookmarkletLang" equals either "fr" or "nl" +*/ + +// Better Lex version +var version = '1.0.0'; + +var d = document, + b = d.body, + w = window; + +var url = d.location.href; + +var lang = detectLang(url); +var alternateLang = (lang === 'fr') ? 'nl' : 'fr'; + +var trans = w._translations[lang]; + + +// ---------------------------------------- +// Utility functions. +// ---------------------------------------- + +// Utility functions are imported by the build script from "src/utility.js" + + +// ---------------------------------------- +// Where the magic happens. +// ---------------------------------------- + +if ((isOnDocument() || isOnLocal()) && !isAlreadyParsed()) { + + // We first inject the CSS into the page. + + var stylesheet = d.createElement('style'); + stylesheet.innerHTML = css; + + d.head.appendChild(stylesheet); + + + // body + // We clean the body as much as possible. + // ---------------------------------------- + + // 's attributes are removed to avoid any CSS inheritance problem. + removeAllAttrs(b); + + /* + 1. Markup homogenization + 2. New lines are removed to ease later parsing + 3. , and are removed + 4 linking to "#t" or having a title are deleted. Typically used + for reference to footnote, useless and would complexify the parsing + 5. Empty or elements are removed + 6. Identifiers and classes are added to every table according to the + value of the preceding hidden anchor + 7. Any (misused) is replaced by a + 8. Typographic improvements + */ + b.innerHTML = b.innerHTML + .replace(/(?:<\/?br\/?>\s?)+/gi, '
') // 1 + .replace(/[\n|\r]/gi, '') // 2 + .replace(/<\/?b>/gi, '') // 3 + .replace(/<\/?(?:font|span)[^>]*?>/gi, '') // " + .replace( // 4 + /([^<]+)<\/a>/gi, + '$1' + ) + .replace(/]*?>\s*?<\/td>/gi, '') // 5 + .replace(/]*?>\s*?<\/tr>/gi, '') // " + .replace( // 6 + /
[^>]*?<\/a>(?:
|\s)*]+>/gi, + '' + ) + .replace(/<(\/?)th[^>]*?>/gi, '<$1td>') // 7 + .replace(/CHAPITRE/g, 'Chapitre') // 8 + .replace(/HOOFDSTUK/g, 'Hoofdstuk') // " + .replace(/TITRE/g, 'Titre') // " + .replace(/TITEL/g, 'Titel') // " + .replace(/ANNEXES/g, 'Annexes') // " + .replace(/BIJLAGEN/g, 'Bijlagen') // " + .replace(/ANNEXE/g, 'Annexe') // " + .replace(/BIJLAGE/g, 'Bijlage'); // " + + // Wrap the HTML into two layers of containers. + b.innerHTML = '
' + b.innerHTML + '
'; + + + // .table-titre + // We clean the 'Titre' table. + // ---------------------------------------- + + var headingsTable = b.getElementsByClassName('table-titre')[0]; + + /* + 1. Titles are wrapped in elements + 2. In cases where various values are provided and separated by "*", + "*" is replaced by
+ 3. "pdf" class is added to link pointing to an "image", wording + is fixed, URL is fixed as well + */ + headingsTable.innerHTML = headingsTable.innerHTML + .replace(/
[^\(]([^:]+ :)/g, '$1') // 1 + .replace(/(?: | )+[\*]+(?: | )+/g, '
') // 2 + .replace( // 3 + /]+href="[^"]+pdf_file=([^"]+\.pdf)"[^>]+>(?:image|beeld)<\/a>/gi, + 'pdf' + ); + + + // .table-text + // We clean the 'Texte' table. + // ---------------------------------------- + + var textTable = b.getElementsByClassName('table-texte')[0]; + + textTable.innerHTML = textTable.innerHTML + .replace( + /(?:
)*(?: | )*]*>[^<]+<\/a>(?: ?]+>[^>]+>[. ]+| ?[^ ]+ ?)(?:
)*/gi, + '
$1  ' + ) + .replace( + /(?:
)*(?: | )*(?:]*>((?:chapitre|hoofdstuk|annexes?).*?)<\/a>(.*?))(?:
|(
$2$3$4' + ) + .replace( + /(?:
)*(?: | )*(?:]*>((?:titre|titel).*?)<\/a>([^<]+))/gi, + '$2$3' + ) + .replace( + /(?:
)*(?: | )*(?:]*>((?:section|afdeling).*?)<\/a>(.*?))(?:
|(
$2$3$4' + ) + .replace( + /(?:
)*(?: | )*(?:]*>((?:sous-section|onderafdeling).*?)<\/a>(.*?))(?:
|(
$2$3$4' + ); + + + // .table-modification + // We clean the 'Modifications' table. + // ---------------------------------------- + + var modificationTable = b.getElementsByClassName('table-modification')[0]; + + /* + 1. "pdf" class is added to link pointing to an "image", wording + is fixed, URL is fixed as well + 2. Modification details are wrapped in + */ + if (modificationTable) { + + modificationTable.innerHTML = modificationTable.innerHTML + .replace( // 1 + /]+href="[^"]+pdf_file=([^"]+\.pdf)"[^>]+>(?:image|beeld)<\/a>/gi, + 'pdf' + ) + .replace(/
(.*?)<\/li>/gi, '
$1'); // 2 + } + + + // Sidebar + // We then create and inject the sidebar. + // ---------------------------------------- + + var sidebar = d.createElement('div'); + sidebar.setAttribute('class', 'sidebar'); + + // The NodeList containing the main tables is converted to an array. + var mainTables = [].slice.call(d.querySelectorAll('[class^=table]')); + + // Array containing useless tables ids + var uselessTablesIds = ['hit0', 'end']; + + // Table of contents + var toc = []; + + mainTables.forEach(function(item) { + + // If the current table is a useful one, + // we add its title to the table of contents. + if (uselessTablesIds.indexOf(item.id) === -1) { + + var selector = '#' + item.id + ' > tbody > tr:first-child > td:first-child'; + + var li = + '
  • ' + + d.querySelector(selector).innerHTML + + '
  • '; + + toc.push(li); + } + }); + + sidebar.innerHTML = + '' + + '
      ' + + '
    • ' + trans.source + '
    • ' + + '
    • ' + trans.trans + '
    • ' + + '
    • ' + trans.nav + '' + + '
        ' + toc.join('') + '
      ' + + '
    • ' + + '
    • ' + trans.display + '' + + '
        ' + + '
      • ' + + '
      • ' + + '
      ' + + '
    • ' + + '
    • ' + trans.font + '' + + '
        ' + + '
      • ' + + '
      • ' + + '
      ' + + '
    • ' + + '
    ' + + '' + + ''; + + b.insertBefore(sidebar, b.firstChild); + + + // Theme switcher. + + d.getElementById('dark').addEventListener('click', function() { + + b.classList.add('dark'); + }); + + d.getElementById('light').addEventListener('click', function() { + + b.classList.remove('dark'); + }); + + + // Font switcher. + + d.getElementById('serif').addEventListener('click', function() { + + b.classList.remove('sans-serif'); + }); + + d.getElementById('sans-serif').addEventListener('click', function() { + + b.classList.add('sans-serif'); + }); + + + // .info-box + // We create and inject the info box. + // ---------------------------------------- + + var infoBox = d.createElement('div'); + infoBox.setAttribute('class', 'info-box sans-serif'); + + infoBox.innerHTML = '

    ' + trans.infoBox + '

    '; + + b.appendChild(infoBox); + + + /* + Hide the info box: + - when the sidebar is opened + - when the info box is clicked upon + - after 7 seconds + */ + + sidebar.addEventListener('mouseover', function() { + + infoBox.classList.add('hidden'); + }); + + infoBox.addEventListener('click', function() { + + infoBox.classList.add('hidden'); + }); + + w.setTimeout(function() { + + infoBox.classList.add('hidden'); + + }, 7000); + + + // Remove the info box if it is not visible anymore. + infoBox.addEventListener('transitionend', function() { + + infoBox.style.display = 'none'; + }); + +} else if (isOnBetterLex()) { + + // If the user is on the Better Lex website, we redirect him/her to the + // homepage passing his/her version and language as parameters. + + d.location = 'http://nurpa.be/better-lex/?version=' + version + '&lang=' + lang; + +} else if (isOnFrame()) { + + // If the user is on a page containing a frame, we redirect him/her to the + // embedded document. + + alert(trans.alertFrame); + + var oldUrl = document.getElementsByTagName('frame')[0].getAttribute('src'); + d.location = reconstructURL(oldUrl); + +} else if (isOnTranslation()) { + + // Translation page can only be reached by clicking on the translation link + // provided on an unparsed page, it contains a frame pointing to a document + // containing a frame... http://youtu.be/CLDSE7RHvno + // + // Rather then trying to deal with all this mess, we reconstruct the URL + // and redirect the user to it. + + alert(trans.alertTrans); + + d.location = reconstructURL(url); + +} else if (isOnSearch() || isAlreadyParsed()) { + + // If the user is on the search form, nothing is done (for the time being). + // If the document has already been parsed, our job is done. + +} else { + + // If the user is not in one of the situations aforementioned, he/she is + // on a random page on the Interwebs, we redirect him/her to the eJustel + // search form. + // + // Due to browser limitations, it won't work on every website + // (or on empty tabs). + // + // See: + // - https://bugzilla.mozilla.org/show_bug.cgi?id=866522 + // - https://bugzilla.mozilla.org/show_bug.cgi?id=728313 + + alert(trans.alertDefault); + + d.location = 'http://www.ejustice.just.fgov.be/cgi_loi/loi_rech.pl?language=' + bookmarkletLang; +} diff --git a/src/translations.json b/src/translations.json new file mode 100644 index 0000000..b603cef --- /dev/null +++ b/src/translations.json @@ -0,0 +1,30 @@ +{ + "fr": { + "alertDefault" : "Better Lex\n\nRedirection vers le formulaire de recherche eJustel.", + "alertFrame" : "Better Lex\n\nRedirection vers le document original.\nLorsque le document est chargé, cliquez à nouveau sur \"Better Lex\".", + "alertTrans" : "Better Lex\n\nRedirection vers le document original.\nLorsque le document est chargé, cliquez à nouveau sur \"Better Lex\".", + "dark" : "Sombre", + "display" : "Th\xE8me", + "font" : "Police", + "infoBox" : "Survolez \xE0 tout moment le bord gauche de la page pour afficher le menu.", + "light" : "Clair", + "nav" : "Navigation", + "source" : "Document original", + "trans" : "Version n\xE9erlandaise", + "update" : "Rechercher mise \xE0 jour" + }, + "nl": { + "alertDefault" : "Better Lex\n\nTerug naar het zoekformulier eJustel.", + "alertFrame" : "Better Lex\n\nTerug naar het oorspronkelijk document.\nWanneer het document geladen is, klik nogmaals op \"Better Lex\".", + "alertTrans" : "Better Lex\n\nTerug naar het oorspronkelijk document.\nWanneer het document geladen is, klik nogmaals op \"Better Lex\".", + "dark" : "Donker", + "display" : "Weergave", + "font" : "Lettertype", + "infoBox" : "Beweeg je muis over de linkerrand van de pagina om het menu weer te geven.", + "light" : "Licht", + "nav" : "Navigatie", + "source" : "Oorspronkelijk document", + "trans" : "Franstalige versie", + "update" : "Zoeken naarr updates" + } +} diff --git a/src/utility.js b/src/utility.js new file mode 100644 index 0000000..19768ed --- /dev/null +++ b/src/utility.js @@ -0,0 +1,137 @@ +// ---------------------------------------- +// Utility functions. +// ---------------------------------------- + +/** + * Check if the document has already been parsed. + * + * @return {Boolean} + */ +function isAlreadyParsed() { + + return !!(d.getElementsByClassName('better-lex')[0]); +} + +/** + * Try to detect the language of the document. + + * If none is found, return the value of the + * global `bookmarkletLang` variable. + * + * @param {string} url + * @return {string} + */ +function detectLang(url) { + + var lang = url.match(/language=(nl|fr)/i); + + if (lang) return lang[1]; + + return bookmarkletLang; +} + +/** + * Check if the person is on the Better Lex website. + * + * @return {Boolean} + */ +function isOnBetterLex() { + + var needle = 'http://nurpa.be/better-lex/'; + + return (url.lastIndexOf(needle, 0) === 0); +} + +/** + * Check if the person is on the page of a document. + * + * @return {Boolean} + */ +function isOnDocument() { + + var needle = 'http://www.ejustice.just.fgov.be/cgi_loi/loi_a1.pl'; + + return (url.lastIndexOf(needle, 0) === 0); +} + +/** + * Check if the document is contained inside a frame. + * + * @return {Boolean} + */ +function isOnFrame() { + + var needle = 'http://www.ejustice.just.fgov.be/cgi_loi/loi_a.pl'; + + return (url.lastIndexOf(needle, 0) === 0); +} + +/** + * Check if the page is viewed locally. + * + * @return {Boolean} + */ +function isOnLocal() { + + return !!(url.match(/^(file|http:\/\/(127|localhost))/i)); +} + +/** + * Check if the person is on the eJustel search page. + * + * @return {Boolean} + */ +function isOnSearch() { + + var needle = 'http://www.ejustice.just.fgov.be/cgi_loi/loi_rech.pl'; + + return (url.lastIndexOf(needle, 0) === 0); +} + +/** + * Check if the person is on a translation page. + * + * @return {Boolean} + */ +function isOnTranslation() { + + var needle = 'http://www.ejustice.just.fgov.be/cgi_loi/change_lg.pl'; + + return (url.lastIndexOf(needle, 0) === 0); +} + +/** + * Build a new URL from an URL and, optionally, a language code. + * + * @param {string} url + * @param {string} trans + * @return {string} + */ +function reconstructURL(url, trans) { + + var cn = url.match(/cn=([^&]+)/i), + lang = trans ? trans : detectLang(url), + fromtab = (lang === 'fr') ? 'loi' : 'wet'; + + var target = + 'http://www.ejustice.just.fgov.be/cgi_loi/loi_a1.pl?caller=list' + + '&cn=' + cn[1] + + '&language=' + lang + + '&fromtab=' + fromtab; + + return target; +} + +/** + * Remove all the attributes of an HTML element. + * + * @param {HTMLElement} element + * @return {void} + */ +function removeAllAttrs(element) { + + for (var i = element.attributes.length; i-- > 0;) { + + element.removeAttribute(element.attributes[i]); + } +}