From: Greg Burri Date: Sun, 1 Jun 2008 17:32:53 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 1.0.0 X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=commitdiff_plain;h=044b3abf1f4b34d4c565175a88a1e40c65cfb08e;hp=ddfef63503fd2c2d640d19655167f3c639076156 --- diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README b/README new file mode 100644 index 0000000..576fb98 --- /dev/null +++ b/README @@ -0,0 +1,71 @@ +Ce document a pour but d'introduire le projet Euphorik, de décrire +sa strucure et son utilisation au niveau du développement et de son +utilisation. + + +== Description == +Euphorik est un site web communautaire développé en Erlang pour le serveur Yaws et utilisant la base de données Mnesia. +Il utilise massivement le javascript et l'AJAX coté client. + +== Installation == +L'installation de Yaws et sa configuration ainsi que l'initialisation de la base de données +est décrit dans le fichier /doc/installation.txt. + + +== Dossiers / Fichiers == + /index.html + La page principale du site. Elle est statique. + + /mise_en_prod.rb + Script permettant la mise en production du site. + + /BD + Contient les fichiers lié à la base de données, initialement vide. + + /css + Contient les feuilles de style de chaque skin contenu dans un dossier représentant le numéro du skin. + + /css/common.css + La feuille de style commune à tous les skins. + + /doc + Contient tous les documents de conception (fonctionnel, technique, etc.). + + /img + Contient les images du site avec un séparation des images propres à chaque skin. + Certaines images sont issues de document de conception se trouvant dans /doc/graphiques. + + /js + Contient tous les scripts JavaScript. Il existe un script général à Euphorik : euphorik.js ainsi qu'un script par page : page*.js + + /lightbox + Lib JavaScript permettant d'afficher des images sous la forme de pop-up modaux. + + /modules + Contient la partie serveur. + + /modules/Makefile + Règle de compilation des modules du serveur. + + /modules/ebin + Contient les modules compilées, initialement vide. + + /module/erl + Contient le code sources des différents modules Erlang. + + /modules/include + Contient certaines définitions (headers). + + /pages + Contient certaines pages XHTML qui seront chargée via AJAX. + + /sessions + Contient différentes sessions de travail pour le développement avec Scite. + + /tool + Contient des outils diverses permettant l'aide au développement ou la mise en production. + + /tool/jsmin.rb + Permet la minification du javascript utilisé lors de la mise en production + + \ No newline at end of file diff --git a/css/1/euphorik.css b/css/1/euphorik.css new file mode 100755 index 0000000..1fdc0f4 --- /dev/null +++ b/css/1/euphorik.css @@ -0,0 +1,233 @@ +/* coding: utf-8 */ + +@import url(pageMinichat.css); +@import url(pageAdmin.css); +@import url(pageProfileRegister.css); +@import url(pageAbout.css); + +* { + padding: 0px; + margin: 0px; +} + +body { + font-family: sans-serif; + font-size: 12px; + color: #841919; + background-color: #f6dfc2; +} + +#container { + height: auto; + margin: 0px; +} + +/***** Menu *****/ +ul#menu { + background-image: url(../../img/css1/logo_fond.png); + height:129px; + width: 100%; + font-size: 11px; + list-style-type:none; +} +#menu li:first-child { + margin-left: 340px; +} +#menu li { + margin-top: 47px; + font-size: 14px; + text-align: center; + cursor: pointer; + height:30px; + z-index: 20; + float: left; + min-width: 60px; + background-color: #f6dfc2; + line-height: 32px; +} +#menu li.courante { + background-color: #ffffff; + background-image: url(../../img/css1/triangle.png); + background-repeat: no-repeat; + background-position: center bottom +} +#menu li:hover { + background-color: #ffffff; +} + +/***** Le menu pour le choix de la CSS *****/ +#menuCss { + position: absolute; + z-index: 10; + left: 550px; + top:0px; + font-size: 9px; +} + +/***** Le style du contenu des pages *****/ +#page { + font-size: 12px; + background-color: #f6dfc2; + padding: 10px 10px 15px 10px; +} +#page > h1 { + margin-top: 10px; + margin-left: 0px; + font-size: 18px; +} +#page > h2 { + margin-top: 10px; + margin-left: 10px; + font-size: 16px; +} +#page > h3 { + margin-top: 10px; + margin-left: 20px; + font-size: 14px; + background-color : #FFFFFF +} +#page > h4 { + margin-top: 10px; + margin-left: 25px; + font-size: 12px; +} +#page > p { + margin-top: 3px; + margin-left: 35px; +} +#page > ul { + margin-top: 3px; + margin-left: 45px; +} +#logo { + z-index: 10; + background-image: url(../../img/css1/logo.png); + background-repeat: no-repeat; + width: 304px; + height: 129px; + position: absolute; +} + +/***** Le pied de page *****/ +#footer { + background-color: #e19671; + text-align: right; + font-size: 9px; + padding: 2px +} +#footer a img{ + border-style: none; + vertical-align: middle; + margin-right: 5px; +} +#footer span{ + margin-right: 10px; +} + +/***** La boite d'information (s'apparente à une MessageBox) *****/ +div#info { + text-align: center; + width:100%; + position: fixed; + left: 0px; + top: 0px; + background-color: #841919; + border-bottom: 1px solid #FFFFFF; + z-index: 20; + color: #f0df95 +} +div#info div.fermer { + float:right; + cursor: pointer; + height:16px; + width: 16px; + background-image: url(../../img/fermer.gif) +} +div#info #icone { + float:left; + height:16px; + width: 16px; +} +div#info #icone.interrogation { + background-image: url(../../img/interrogation.gif) +} +div#info #icone.information { + background-image: url(../../img/information.gif) +} +div#info #icone.exclamation { + background-image: url(../../img/exclamation.gif) +} +div#info .boutons { + padding: 1px; +} +div#info .boutons div { + cursor: pointer; + background-color: #c62929; + display: inline; + padding: 0px 5px 0px 5px; + margin: 0px 5px 0px 5px; +} +div#info .boutons div:hover { + background-color: #e84747; +} + +/***** Les infos bulles *****/ +#flecheBulle { + position: absolute; + z-index: 50; + width: 15px; + height: 8px; + background-image: url(../../img/css1/fleche_bulle.png); + display: none +} +#messageBulle { + position: absolute; + z-index: 50; + color: #ffffff; + background-color: #841919; + display: none; + font-size: 10px; +} +#messageBulle p { + padding: 3px 6px; +} + +/***** Le faux captcha *****/ +.captcha { + display:none; +} + +/***** Les formulaires *****/ +form input, +form button, +form select { + background-color: #f0df95; + border: #841919 1px solid; +} +form input:hover, form input:focus, +form button:hover, form button:focus, +form select:hover, form select:focus { + background-color: #ffffff; +} +form input, +form select { + font-size: 12px; +} +form button { + font-size: 11px; +} + +/***** Les liens *****/ +.lien, a { + text-decoration: underline; + color: #c62929; +} +.lien { + cursor: pointer +} +a:link, a:visited { + color: #c62929; +} +.lien:hover, .lien:active, a:hover, a:active { + color: #e84747; +} diff --git a/css/1/pageAbout.css b/css/1/pageAbout.css new file mode 100644 index 0000000..f21cd61 --- /dev/null +++ b/css/1/pageAbout.css @@ -0,0 +1,4 @@ +/* coding: utf-8 */ + +#page.about { +} diff --git a/css/1/pageAdmin.css b/css/1/pageAdmin.css new file mode 100644 index 0000000..47272a1 --- /dev/null +++ b/css/1/pageAdmin.css @@ -0,0 +1,80 @@ +/* coding: utf-8 */ +/* La page d'administration */ + +#page.admin p { + margin-left : 0px +} + +#page.admin form#nouveauTroll { + margin-top : 10px +} + +#page.admin form#nouveauTroll input { + width: 80% +} + +#page.admin div.troll, +#page.admin .ban { + margin-top: 5px; + padding: 2px 10px 2px 10px; + border: 1px solid; + background-color: #841919; + color: #ffffff; +} + +#page.admin div.troll img { + margin: 0px; + vertical-align: bottom; +} + +#page.admin div.troll span.content { + font-style: italic; +} + +#page.admin div.troll .author { + margin-left: 10px; +} + +#page.admin div.troll input { + width: 70% +} + +#page.admin div.troll .editTroll, +#page.admin div.troll .delTroll, +#page.admin div.troll .modifier, +#page.admin div.troll .annuler, +#page.admin div.ban .deban +{ + font-size: 10px; + margin-left: 10px; + cursor: pointer; + padding-right: 5px; + padding-left: 5px; + background-color: #f0df95; + border: #841919 1px solid; + color: #841919; +} + +#page.admin div.troll .editTroll:hover, +#page.admin div.troll .delTroll:hover, +#page.admin div.troll .modifier:hover, +#page.admin div.troll .annuler:hover, +#page.admin div.ban .deban:hover +{ + background-color: #ffffff; +} + +#page.admin #ips .ip { + margin-right : 10px; + color: #ffffff; +} + +#page.admin #ips .temps, +#page.admin #ips .pseudo { + margin-left : 10px; + margin-right : 10px; +} + +#page.admin #ips .login { + margin-right : 4px; +} diff --git a/css/1/pageMinichat.css b/css/1/pageMinichat.css new file mode 100755 index 0000000..d555074 --- /dev/null +++ b/css/1/pageMinichat.css @@ -0,0 +1,276 @@ +/* coding: utf-8 */ + +#page.minichat { + padding: 0px; +} + +#page.minichat img { + margin: 0px; + vertical-align: middle; +} + +/***** La boite de sélection des smiles *****/ +#smiles { + text-align: center; + border: 1px solid; + border-color: #ffffff; + background-color: #f6dfc2; + margin-bottom: 10px; + padding: 1px; + width: 140px; + position: absolute; + display: none +} +#smiles img { + margin: 1px; + cursor: pointer; + opacity: 0.5; +} + +/***** La boite permettant de slaper/kicker/bannir une personne *****/ +#outilsBan { + border-width: 1px 1px 1px 1px; + border-color: #ffffff; + border-style: dotted; + padding: 2px; + position: absolute; + display: none; +} +#outilsBan img, +#outilsBan form { + float: right; + cursor: pointer +} +#outilsBan p { + font-size: 2px; +} +#outilsBan input { + font-size: 9px; + margin-top: 1px; + margin-left: 1px +} + +/***** Le troll courant affiché en haut de la page *****/ +#page.minichat #trollCourant { + color: #FFFFFF; + position: absolute; + z-index: 20; + left: 140px; + top: 77px; + line-height: 32px; +} +#page.minichat #trollCourant .troll { + cursor: pointer; + font-style: italic +} + +/***** Le formulaire pour poster un message *****/ +#page.minichat form#posterMessage { + background-color: #e19671; + padding-left: 10px; + padding-bottom: 10px; +} +#page.minichat form#posterMessage p { + margin: 0px; + padding: 0px; +} +#page.minichat form#posterMessage .pseudo { + margin-right: 5px; + width: 12% +} +#page.minichat form#posterMessage .message { + margin-right: 5px; + width: 75% +} +#page.minichat form#posterMessage .return { + height: 16px; + width: 32px; + background-image: url(../../img/css1/return.png); + background-repeat: no-repeat; + background-position: 5px 2px; + vertical-align: top; + margin-right: 5px; +} +#page.minichat form#posterMessage .smiles { + height: 16px; + width: 16px; + background-image: url(../../img/css2/bouton_smiles.png); + background-repeat: no-repeat; + background-position: 2px 2px; + vertical-align: top; + margin-right: 5px; +} + +/***** Les conversations *****/ +/* voir pour l'astuce css "float left" des conversations : http://www.quirksmode.org/css/clearing.html */ +#page.minichat #conversations { + overflow: hidden; + width: 100% +} +#page.minichat #conversations .conversation { + border-width: 0px; + border-style: solid; + border-color: white; + float: left; + width: 100%; +} +#page.minichat #conversations div.message { + border-left-width: 5px; + border-left-style: solid; + border-color: transparent; + padding-right: 5px; + cursor: pointer; + min-height: 18px; + line-height: 18px; +} +#page.minichat #conversations div.messageImpair { + background-color: #fbeede; +} +#page.minichat #conversations div.messagePair { + background-color: #f6dfc2; +} +#page.minichat #conversations div.cache { + opacity: 0.3; + + /* Hack IE 7 */ + filter: alpha(opacity = 30); + zoom: 1 +} +#page.minichat #conversations div.reponse { + border-color: #bd7a11 +} +#page.minichat #conversations div.repondu { + border-color: #b711bd +} +#page.minichat #conversations div.proprietaire { + border-color: #bd1129 +} +#page.minichat #conversations div.systeme { + background-color: #f0df95 +} +#page.minichat #conversations .titre { + text-align: center; + padding-right: 8px; + background-color: #e19671; + color: #ffffff; +} +#page.minichat #conversations .titre .fermer { + margin-top: 1px; + margin-left: 5px; + float: right; + width: 13px; + height: 13px; + background-image: url(../../img/css1/fermer_conv.png); + cursor: pointer; +} +#page.minichat #conversations .titre .fermer:hover { + background-image: url(../../img/css1/fermer_conv_hover.png); +} +#page.minichat #conversations .titre .lien { + margin-top: 1px; + float: right; + width: 13px; + height: 13px; + background-image: url(../../img/css1/copier_conv.png); + cursor: pointer; +} +#page.minichat #conversations .titre .lien:hover { + background-image: url(../../img/css1/copier_conv_hover.png); +} +#page.minichat #conversations .titre .next, +#page.minichat #conversations .titre .prev { + display: none; +} +#page.minichat #conversations .titre .next, +#page.minichat #conversations .titre .prev, +#page.minichat #conversations .titre .numPage { + background-color: #841919; + cursor: pointer; + padding-right: 5px; + padding-left: 5px; +} +#page.minichat #conversations .titre .next:hover, +#page.minichat #conversations .titre .prev:hover, +#page.minichat #conversations .titre .numPage:hover { + background-color: #cb2626 +} + +/***** Les messages *****/ +#page.minichat div.message a { + font-weight: bold; +} +#page.minichat div.message .lienConv { + color: #c62929; + font-weight: bold; + cursor: pointer +} +#page.minichat div.message .lienConv:hover { + color: #e84747 +} +#page.minichat .entete { + z-index: 20; + background-color: #841919; + color: #f6dfc2; + display: block; + float: left; + height: 18px; +} +#page.minichat .delimitationEntete { + z-index: 20; + height: 18px; + width: 7px; + background-image: url(../../img/css1/fleche.png); + display: block; + float: left; +} +#page.minichat .date { + margin-right: 3px; + margin-left: 3px; +} +#page.minichat div.message .pseudo, +/* FIXME : entre en conflit avec une règle précédente */ +#page.minichat form .pseudo { + margin-left: 4px; + margin-right: 2px; + font-weight: bold; +} +#page.minichat div.message.ekMaster .pseudo { + color: #f0df95 +} +#page.minichat div.message .pseudo .login { + margin-left: 2px; + font-size: 8px; +} +#page.minichat #conversations .repondA { + z-index: 5; + height: 18px; + margin-left: -7px; + padding-left: 9px; + float: left; + background-color: #cb2626; + color: #ffffff; + display: block; + background-image: url(../../img/css1/fleche.png); + background-repeat: no-repeat; +} +#page.minichat #conversations .delimitationRepondA { + z-index: 20; + height: 18px; + width: 7px; + background-image: url(../../img/css1/fleche_reponda.png); + display: block; + float: left; +} +#page.minichat #conversations .contenu { + margin-left: 5px; +} +#page.minichat #conversations .extraire { + float: right; + width: 13px; + height: 13px; + background-image: url(../../img/css1/extraction.png); + margin-top: 2px +} +#page.minichat #conversations .extraire:hover { + background-image: url(../../img/css1/extraction_hover.png); +} diff --git a/css/1/pageProfileRegister.css b/css/1/pageProfileRegister.css new file mode 100755 index 0000000..1455823 --- /dev/null +++ b/css/1/pageProfileRegister.css @@ -0,0 +1,7 @@ +/* coding: utf-8 */ +/* Réunit les page Profile et Register car ils ont beaucoup en commun */ + +#page.register, +#page.profile { + padding-top: 20px +} diff --git a/css/2/euphorik.css b/css/2/euphorik.css new file mode 100755 index 0000000..ca5992e --- /dev/null +++ b/css/2/euphorik.css @@ -0,0 +1,227 @@ +/* coding: utf-8 */ + +@import url(pageMinichat.css); +@import url(pageAdmin.css); +@import url(pageProfileRegister.css); +@import url(pageAbout.css); + +* { + padding: 0px; + margin: 0px; +} + +body { + font-family: sans-serif; + font-size: 12px; + color: #EEEEEE; + background-color: #DFDFDF; + background-image: url(../../img/css2/fond.png) +} + +#container { + height: auto; + margin-left: 10px; + margin-right: 10px; + margin-top: 40px; +} + +/***** Menu *****/ +ul#menu { + padding-left: 300px; + height: 23px; + font-size: 11px; + background-color: #000000; + list-style-type:none; +} +#menu li { + cursor: pointer; + z-index: 20; + float: left; + padding: 2px; + margin-left: 2px; + background-color: #4f5519; +} +#menu li.courante { + background-color: #818c27; +} +#menu li:hover { + background-color: #818c27 +} + +/***** Le menu pour le choix de la CSS *****/ +#menuCss { + position: absolute; + z-index: 10; + left: 600px; + top:40px; + font-size: 9px; +} + +/***** Le style du contenu des pages *****/ +#page { + font-size: 12px; + background-color: #000000; + padding: 10px 10px 15px 10px; +} +#page > h1 { + margin-top: 10px; + margin-left: 0px; + font-size: 18px; + color : #a6b80e +} +#page > h2 { + margin-top: 10px; + margin-left: 10px; + font-size: 16px; + color : #899714; +} +#page > h3 { + margin-top: 10px; + margin-left: 20px; + font-size: 14px; + color : #79841a; + background-color : #1e2201 +} +#page > h4 { + margin-top: 10px; + margin-left: 25px; + font-size: 12px; + color : #646d1d +} +#page > p { + margin-top: 3px; + margin-left: 35px; + color : #e9e9e9 +} +#page > ul { + margin-top: 3px; + margin-left: 45px; + color: #e9e9e9 +} +#logo { + z-index: 10; + background-image: url(../../img/css2/logo_2.png); + width: 253px; + height: 37px; + position: absolute; + top: 20px; + left: 4px; +} + +/***** Le pied de page *****/ +#footer { + text-align: right; + font-size: 9px +} +#footer a img{ + border-style: none; + vertical-align: middle; + margin-right: 5px; +} +#footer span{ + margin-right: 10px; +} + +/***** La boite d'information (s'apparente à une MessageBox) *****/ +div#info { + text-align: center; + width:100%; + position: fixed; + left: 0px; + top: 0px; + background-color: #000000; + border-bottom: 1px solid #aeaeae; + z-index: 20; +} +div#info div.fermer { + float:right; + cursor: pointer; + height:16px; + width: 16px; + background-image: url(../../img/fermer.gif) +} +div#info #icone { + float:left; + height:16px; + width: 16px; +} +div#info #icone.interrogation { + background-image: url(../../img/interrogation.gif) +} +div#info #icone.information { + background-image: url(../../img/information.gif) +} +div#info #icone.exclamation { + background-image: url(../../img/exclamation.gif) +} +div#info .boutons { + padding: 1px; +} +div#info .boutons div { + cursor: pointer; + background-color: #770000; + display: inline; + padding: 0px 5px 0px 5px; + margin: 0px 5px 0px 5px; +} +div#info .boutons div:hover { + background-color: #bc0000; +} + +/***** Les infos bulles *****/ +#flecheBulle { + position: absolute; + z-index: 50; + width: 15px; + height: 8px; + background-image: url(../../img/css2/fleche_bulle.png); + display: none +} +#messageBulle { + position: absolute; + z-index: 50; + color: #ffffff; + background-color: #164200; + display: none; + font-size: 10px; +} +#messageBulle p { + padding: 3px 6px; +} + +/***** Le faux captcha *****/ +.captcha { + display:none +} + +/***** Les formulaires *****/ +form input, +form button, +form select { + background-color: #164200; + border: #2d8800 1px solid; + color: #EEEEEE; +} +form input, +form select { + font-size: 12px; +} +form button { + font-size: 11px; +} + +/***** Les liens *****/ +.lien, a { + text-decoration: none; + color: #7664ff; +} +.lien { + cursor: pointer; +} +a:link, a:visited { + color: #7664ff; +} +.lien:hover, .lien:active, a:hover, a:active { + color: #ffad0f; +} + diff --git a/css/2/pageAbout.css b/css/2/pageAbout.css new file mode 100644 index 0000000..f21cd61 --- /dev/null +++ b/css/2/pageAbout.css @@ -0,0 +1,4 @@ +/* coding: utf-8 */ + +#page.about { +} diff --git a/css/2/pageAdmin.css b/css/2/pageAdmin.css new file mode 100644 index 0000000..371b601 --- /dev/null +++ b/css/2/pageAdmin.css @@ -0,0 +1,77 @@ +/* coding: utf-8 */ +/* La page d'administration */ + +#page.admin p { + margin-left : 0px +} + +#page.admin form#nouveauTroll { + margin-top : 10px +} + +#page.admin form#nouveauTroll input { + width: 80% +} + +#page.admin div.troll, +#page.admin .ban { + margin-top: 10px; + padding: 2px 10px 2px 10px; + border: 1px solid; + border-color: #253f18; + background-color: #0c2003; +} + +#page.admin div.troll img { + margin: 0px; + vertical-align: bottom; +} + +#page.admin div.troll span.content { + font-style: italic; + color: #FFFF88 +} + +#page.admin div.troll .author { + margin-left: 10px +} + +#page.admin div.troll input { + width: 70% +} + +#page.admin div.troll .editTroll, +#page.admin div.troll .delTroll, +#page.admin div.troll .modifier, +#page.admin div.troll .annuler, +#page.admin div.ban .deban +{ + font-size: 10px; + margin-left: 10px; + cursor: pointer; + padding-right: 5px; + padding-left: 5px; + background-color: #164200; + border: #2d8800 1px solid; + color: #EEEEEE; +} + + +#page.admin #ips .ip { + margin-right : 10px; +} + +#page.admin #ips .temps, +#page.admin #ips .pseudo { + margin-left : 10px; + margin-right : 10px; +} + +#page.admin #ips .login { + margin-right : 4px; +} + + + + + diff --git a/css/2/pageMinichat.css b/css/2/pageMinichat.css new file mode 100755 index 0000000..0c5b96a --- /dev/null +++ b/css/2/pageMinichat.css @@ -0,0 +1,253 @@ +/* coding: utf-8 */ + +#page.minichat { + padding-top: 5px; + padding-right: 0px; + padding-left: 0px +} + +#page.minichat img { + margin: 0px; + vertical-align: middle; +} + +/***** La boite de sélection des smiles *****/ +#smiles { + text-align: center; + border: 1px solid; + border-color: #253f18; + background-color: #0c2003; + margin-bottom: 10px; + padding: 1px; + width: 140px; + position: absolute; + display: none +} +#smiles img { + margin: 1px; + cursor: pointer; + opacity: 0.5; +} + +/***** La boite permettant de slaper/kicker/bannir une personne *****/ +#outilsBan { + border-width: 1px 1px 1px 1px; + border-color: #253f18; + border-style: solid; + padding: 2px; + position: absolute; + display: none; +} +#outilsBan img, +#outilsBan form { + float: right; + cursor: pointer +} +#outilsBan p { + font-size: 2px; +} +#outilsBan input { + font-size: 9px; + margin-top: 1px; + margin-left: 1px +} + +/***** Le troll courant affiché en haut de la page *****/ +#page.minichat #trollCourant { + border-top: 1px solid; + border-bottom: 1px solid; + border-color: #253f18; + background-color: #0c2003; + margin-top: 4px; + margin-bottom: 8px; + padding : 1px 0px 1px 10px +} +#page.minichat #trollCourant .troll { + font-style: italic; + color: #FFFF88; + cursor: pointer; +} + +/***** Le formulaire pour poster un message *****/ +#page.minichat form#posterMessage { + margin-bottom: 15px; + padding-left: 10px; +} +#page.minichat form#posterMessage p { + margin: 0px; + padding: 0px; +} +#page.minichat form#posterMessage .pseudo { + margin-right: 5px; + width: 12% +} +#page.minichat form#posterMessage .message { + margin-right: 5px; + width: 75% +} +#page.minichat form#posterMessage .return { + height: 16px; + width: 32px; + background-image: url(../../img/css2/return.png); + background-repeat: no-repeat; + background-position: 5px 2px; + vertical-align: top; + margin-right: 5px; +} +#page.minichat form#posterMessage .smiles { + height: 16px; + width: 16px; + background-image: url(../../img/css2/bouton_smiles.png); + background-repeat: no-repeat; + background-position: 2px 2px; + vertical-align: top; + margin-right: 5px; +} + +/***** Les conversations *****/ +/* voir pour l'astuce css "float left" des conversations : http://www.quirksmode.org/css/clearing.html */ +#page.minichat #conversations { + overflow: hidden; + width: 100% +} +#page.minichat #conversations .conversation { + border-width: 0px; + border-style: solid; + border-color: white; + float: left; + width: 100%; +} +#page.minichat #conversations div.message { + border-left-width: 5px; + border-left-style: solid; + border-color: transparent; + padding-right: 5px; + padding-left: 4px; + cursor: pointer; +} +#page.minichat #conversations div.messageImpair { + background-color: #05002c; +} +#page.minichat #conversations div.messagePair { + background-color: #080047; +} +#page.minichat #conversations div.cache { + opacity: 0.3; + + /* Hack IE 7 */ + filter: alpha(opacity = 30); + zoom: 1 +} +#page.minichat #conversations div.reponse { + border-color: #bd7a11 +} +#page.minichat #conversations div.repondu { + border-color: #b711bd +} +#page.minichat #conversations div.proprietaire { + border-color: #bd1129 +} +#page.minichat #conversations div.systeme { + background-color: #555555 +} +#page.minichat #conversations .titre { + text-align: center; + padding-right: 8px; + background-color: #4b4215 +} +#page.minichat #conversations .titre .fermer { + float: right; + padding-right: 5px; + padding-left: 5px; + background-color: #7d1b1b; + cursor: pointer; +} +#page.minichat #conversations .titre .fermer:after { + content: "x" +} +#page.minichat #conversations .titre .fermer:hover { + background-color: #c95656 +} +#page.minichat #conversations .titre .next, +#page.minichat #conversations .titre .prev { + display: none; +} +#page.minichat #conversations .titre .lien { + float: right +} +#page.minichat #conversations .titre .lien:after { + content: "c" +} +#page.minichat #conversations .titre .lien, +#page.minichat #conversations .titre .next, +#page.minichat #conversations .titre .prev, +#page.minichat #conversations .titre .numPage { + background-color: #42380b; + cursor: pointer; + padding-right: 5px; + padding-left: 5px; +} +#page.minichat #conversations .titre .lien:hover, +#page.minichat #conversations .titre .next:hover, +#page.minichat #conversations .titre .prev:hover, +#page.minichat #conversations .titre .numPage:hover { + background-color: #7c6e2e +} + +/***** Les messages *****/ +#page.minichat div.message a { + font-weight: bold; +} +#page.minichat div.message .lienConv { + color: #db960f; + font-weight: bold; + cursor: pointer +} +#page.minichat div.message .lienConv:hover { + color: #f1c060 +} +#page.minichat .date { + color: #fd913b; + margin-right: 3px; + margin-left: 3px; +} +#page.minichat div.message .pseudo:after { + content: ":" +} +#page.minichat div.message .pseudo, +#page.minichat form .pseudo { + margin-left: 4px; + margin-right: 2px; + font-weight: bold; + color: #76ff33; +} +#page.minichat div.message.ekMaster .pseudo { + color: #ffffff; +} +#page.minichat div.message .pseudo .login { + margin-left: 2px; + font-size: 8px; + color: #a7d88f; +} +#page.minichat div.systeme .pseudo { + color: #CCCCCC +} +#page.minichat #conversations .repondA { + color: #bd7a11; + margin-right: 3px; +} +#page.minichat #conversations .repondA:after { + content: ">" +} +#page.minichat #conversations .extraire { + float: right; + padding-right: 2px; + padding-left: 2px; + background-color: #4f5519; +} +#page.minichat #conversations .extraire:after { + content: ">" +} +#page.minichat #conversations .extraire:hover { + background-color: #818c27 +} diff --git a/css/2/pageProfileRegister.css b/css/2/pageProfileRegister.css new file mode 100755 index 0000000..d5ff7f1 --- /dev/null +++ b/css/2/pageProfileRegister.css @@ -0,0 +1,7 @@ +/* coding: utf-8 */ +/* Réunit les page Profile et Register car ils ont beaucoup en commun */ + +#page.register, +#page.profile { + padding-top: 20px +} diff --git a/css/3/euphorik.css b/css/3/euphorik.css new file mode 100755 index 0000000..9a45b6e --- /dev/null +++ b/css/3/euphorik.css @@ -0,0 +1,171 @@ + +@import url(pageMinichat.css); +@import url(pageProfileRegister.css); + +* { + padding: 0; + margin: 0; +} + +body { + font-family: sans-serif; + font-size: 10pt; + color: #000000; + text-align: center; /* uniquement pour IE */ + background-color: #837fb7; +} + +#container { + position: relative; + background-image: url(../../img/css3/logo.png); + background-repeat: repeat-x; + background-color: #b1b0d4; + width: 626px; + height: auto; + margin-left: auto; + margin-right: auto; +} + +#menu { + z-index: 10; + left: 503px; + top: 5px; + position: absolute; + font-size: 7pt; + text-align: left; +} + +#menu div { + cursor: pointer; +} +#menu div.courante { + background-color: #e6e770 +} +#menu div:hover, +#menuCss div:hover { + background-color: #e6e770 +} + +#menuCss { + text-align: right; + z-index: 10; + position: absolute; + left: 570px; + top: 5px; +} + +#menuCss div { + cursor: pointer; + font-size: 6pt; +} + +#page { + position: relative; + padding: 130px 0px 3px 0px; + font-size: 8pt; +} + +#logo { display: none; } + +#footer { + padding-top: 5px; + text-align: center; + width: 625px; + height: 27px; + background-image: url(../../img/css3/piedpage.png); + background-repeat: no-repeat; +} +#footer a img{ + border-style: none; +} + +#info { + width:100%; + position: fixed; + left: 0px; + top: 0px; + background-color: #d5d3ef; + border-bottom: 1px solid #837fb7; + z-index: 20; +} + +#info .fermer { + float:right; + cursor: pointer; + height:16px; + width: 16px; + background-image: url(../../img/fermer.gif) +} + +#info #icone { + float:left; + height:16px; + width: 16px; +} +#info #icone.interrogation { + background-image: url(../../img/interrogation.gif) +} +#info #icone.information { + background-image: url(../../img/information.gif) +} +#info #icone.exclamation { + background-image: url(../../img/exclamation.gif) +} + +#info .boutons { + padding: 1px; + margin-bottom: 2px; +} + +#info .boutons div { + cursor: pointer; + background-color: #b1b0d4; + display: inline; + padding: 0px 5px 0px 5px; + margin: 0px 5px 0px 5px; + border: 1px solid #837fb7; +} +#info .boutons div:hover { + background-color: #d5d3ef; +} + +.captcha { + display:none +} + +/* Obsolète +#captcha { + margin-bottom: 5px; +} +#captcha input { + margin-left: 5px; +} +#captcha .captchaImg { + background-color: #FFFFFF; + vertical-align: bottom; +}*/ + +form input, +form button { + background-color: #d5d3ef; + border: #837fb7 1px solid; + color: #000000; + font-size: 9pt; +} + +a { + text-decoration: underline; +} +a:link { + color: #1f15e8; +} +a:visited { + color: #1f15e8; +} +a:hover { + color: #645fd4; +} +a:active { + color: #645fd4; +} + diff --git a/css/3/pageMinichat.css b/css/3/pageMinichat.css new file mode 100755 index 0000000..d8f8706 --- /dev/null +++ b/css/3/pageMinichat.css @@ -0,0 +1,155 @@ + +#page.minichat img { + vertical-align: bottom; + margin-right: 1px; + margin-left: 1px; +} + +#page.minichat #smiles { + position: absolute; + top: 90px; + left: 104px; + margin-bottom: 10px; + padding: 1px; +} + +#page.minichat #smiles img { + margin-left: 9px; + cursor: pointer; + opacity: 0.5; +} + +#page.minichat form { + text-align: left; + margin-bottom: 15px; + padding-left: 10px; +} + +#page.minichat form .pseudo { + margin-right: 5px; +} + +#page.minichat form .message { + margin-right: 5px; +} + +#page.minichat form .return { + height: 15px; + width: 32px; + background-image: url(../../img/css1/return.png); + background-repeat: no-repeat; + background-position: 5px 2px; + vertical-align: top; +} + +#page.minichat #messages div.message { + border-left-width: 5px; + border-left-style: solid; + border-color: transparent; + text-align: left; + padding-right: 8px; + padding-left: 4px; + cursor: pointer; +} + +#page.minichat #messages div.messageImpair { + background-color: #9f9cd2; +} + +#page.minichat #messages div.messagePair { + background-color: #b2afd5; +} + +/* Il n'y a plus de mise en evidence +#page.minichat #messages div.miseEnEvidenceReponse { + background-color: #bd7a11; +} +#page.minichat #messages div.miseEnEvidenceCourant { + background-color: #bd1129; +} +#page.minichat #messages div.miseEnEvidenceConversation { + background-color: #b711bd; +}*/ + +#page.minichat #messages div.cache { + opacity: 0.3; + + /* Hack IE 7 */ + filter: alpha(opacity = 30); + zoom: 1 +} + +#page.minichat #messages div.reponse { + border-color: #bd7a11 +} +#page.minichat #messages div.repondu { + border-color: #b711bd +} +#page.minichat #messages div.proprietaire { + border-color: #bd1129 +} +#page.minichat #messages div.systeme { + background-color: #888888 +} + +#page.minichat div.message a { + font-weight: bold; +} + +#page.minichat .date { + display: inline; + color: #8a4106; + margin-right: 3px; + margin-left: 3px; +} + +#page.minichat div.message .pseudo, +#page.minichat form .pseudo { + display: inline; + margin-left: 4px; + margin-right: 2px; + font-weight: bold; + color: #8f4108; +} + +#page.minichat div.systeme .pseudo { + color: #CCCCCC +} + +/* Ca marche pas :( +#page.minichat div.message .pseudo { + min-width: 50px; + height:100px; +}*/ + +#page.minichat #messages .repondA { + display: inline; + margin-left: 4px; + color: #704605 +} + +#page.minichat #messages .contenu { + display: inline; +} + +#page.minichat #pages { + margin-top: 5px; +} + +#page.minichat #pages span { + padding-right : 5px; + padding-left: 5px; + color: #1f15e8; + cursor:pointer; +} + +#page.minichat #pages span.pageCourante { + font-weight: bold; + font-size: 150%; +} + +#page.minichat #pages span:hover { + font-size: 150%; + color: #645fd4; +} + diff --git a/css/3/pageProfileRegister.css b/css/3/pageProfileRegister.css new file mode 100755 index 0000000..50be113 --- /dev/null +++ b/css/3/pageProfileRegister.css @@ -0,0 +1,8 @@ +/* Réunit les page Profile et Register car ils ont beaucoup en commun */ + +#page.register, +#page.profile { + text-align: left; + padding-left: 10px; + padding-bottom: 10px; +} diff --git a/css/jquery.lightbox.css b/css/jquery.lightbox.css new file mode 100644 index 0000000..fea1a99 --- /dev/null +++ b/css/jquery.lightbox.css @@ -0,0 +1,101 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.css + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ +#jquery-overlay { + position: absolute; + top: 0; + left: 0; + z-index: 90; + width: 100%; + height: 500px; +} +#jquery-lightbox { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 100; + text-align: center; + line-height: 0; +} +#jquery-lightbox a img { border: none; } +#lightbox-container-image-box { + position: relative; + background-color: #fff; + width: 250px; + height: 250px; + margin: 0 auto; +} +#lightbox-container-image { padding: 10px; } +#lightbox-loading { + position: absolute; + top: 40%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} +#lightbox-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} +#lightbox-container-image-box > #lightbox-nav { left: 0; } +#lightbox-nav a { outline: none;} +#lightbox-nav-btnPrev, #lightbox-nav-btnNext { + width: 49%; + height: 100%; + zoom: 1; + display: block; +} +#lightbox-nav-btnPrev { + left: 0; + float: left; +} +#lightbox-nav-btnNext { + right: 0; + float: right; +} +#lightbox-container-image-data-box { + font: 10px Verdana, Helvetica, sans-serif; + background-color: #fff; + margin: 0 auto; + line-height: 1.4em; + overflow: auto; + width: 100%; + padding: 0 10px 0; +} +#lightbox-container-image-data { + padding: 0 10px; + color: #666; +} +#lightbox-container-image-data #lightbox-image-details { + width: 70%; + float: left; + text-align: left; +} +#lightbox-image-details-caption { font-weight: bold; } +#lightbox-image-details-currentNumber { + display: block; + clear: left; + padding-bottom: 1.0em; +} +#lightbox-secNav-btnClose { + width: 66px; + float: right; + padding-bottom: 0.7em; +} \ No newline at end of file diff --git a/doc/TODO.txt b/doc/TODO.txt new file mode 100755 index 0000000..42f132c --- /dev/null +++ b/doc/TODO.txt @@ -0,0 +1,309 @@ +== TODO == + +=== v1.0 === +* Corriger les bugs de niveau [1] et [2] +* Cleaner le code (erl, js, xhtml, css) et eventuellement profiler un peu (le refresh est lent sous opera) +=== v1.1 === +* Mettre un icon (genre sablier ou truc qui tourne à la apple) lorsque le chat se charge (également lors d'un changement de page par exemple) + * Simuler un réseau lent +* Création d'un script ruby dans /tool pour apposer automatiquement une entête concernant la licence voir : http://www.gnu.org/licenses/gpl-howto.fr.html + * Eventuellement mettre à jour automatiquement le Copyright (date) et les personnes responsables +* Mise à jour automatique de la version dans le about en fonction du tag/branche courant ? +* Modération des messages : les modos peuvent les supprimer +* Tests de monter en charge coté serveur, analyse de la complexité (regarder du coté des TODO dans le code). Utiliser eventuellement Tsung +* Profiling pour améliorer les performances (client et serveur) + * traitementComplet() de euphorik.js est très très lent à executer +* Traiter les tags TODO et FIXME dans le code +* Pouvoir récupérer son mdp (ou en générer un autre) via son email +=== v1.2 === +* Intégrer les totoz : http://www.totoz.eu/ (avec une limite de 3 par messages par exemple) + * avoir une option pour les cacher ou les voir + * Masquer systématiquement ceux qui dépassent une certaine taille en pixel +=== V1.3 === +* Shift-enter pour ajouter une ligne dans la ligne de saisie (retour à la ligne) + * Crée un
XHTML (lf -> br coté client) + * A chaque Shift-enter la textbox s'agrandit d'une ligne + * Pouvoir activer pas défaut la présentation multi-ligne via le profile +* Système de commande / + * /nick : changer de pseudo + * /me : "* " + * /blam : permet d'envoyer un blame à qqun (uniquement depuis un modo vers un non-modo) + * /+ blabla Pourvoir ajouter du texte (correctif en général) à son dernier message par une commande. Le texte ajouté est mise en évidence. Ceci peut être fait plusieurs fois. +* Ajout des wikilien : [[chien de prairie]] -> http://fr.wikipedia.org/wiki/Chien_de_prairie +=== V1.4 === +* Elaborer une stratégie de mise à jour de la structure de la BD quand celle ci est modifiée (voir euphorik_bd:vers_version()) +* Ajouter un skin "simple" sans images ni fioritures (éventuellement le proposer par défaut) +* Créer un style "super old school" (couleur 8 bit, pas de smiles/images, font fixe) +=== V1.5 === +* Gestion de l'historique au niveau du navigateur (pouvoir revenir aux pages précédentes). Utiliser un plugin jQuery si possible. +* gestion des timezone (fuseaux horaire) : + * L'utilisateur peut simplement définir une timezone dans son profil, les dates sont alors affichées en fonction de sa zone (en option) +* Transfert des messages XML (AJAX) en https et le noter dans la faq (même la mafia chinoise ne peut pas sniffer les messages). En fait il suffit (sauf erreur) de sécuriser euphorik : https://www.euphorik.ch + * voir : http://cert.startcom.org/ pour un certif gratuit +* Conversations : url vers conversation(s) + également un bouton sur chaque conversation pour obtenir l'url vers celle ci. (genre google map) + + +[ok] Réaliser la structure suivante : + * Table minichat : {id, auteur_id, date, pseudo, contenu, reponses_minichat_id} reponses_minichat_id peut être null + * Table reponse_minichat : {id, minichat_id} la clef est (id, minichat_id) + * Table user : {id, cookie, pseudo, date_creation, date_derniere_connexion, css} +[ok] Implémenter le protocole dans 'fonctionnement_minichat.txt' +[ok] Trier la requête et limiter à N le nombre de messages affichés +[ok] réaliser un controller sous la forme d'une application pour receptionner tout ce qui vient des formulaires +[ok] Ajouter un lien minichat.iduser -> user.id +[ok] Ajouter un id pour les messages qui est un entier auto incrémenté +[ok] Afficher un captcha le md5 de la valeur est l'envoyer avec +[ok] Formater les dates +[ok] Trouver et remplacer les url http://www.youpla.com par [url] +[ok] Traitement des smiles, remplacer :) par "" + * Pour ne pas entrer en conflit avec totoz.eu la notation est la suivante : [=slurp] + * La notation totoz.eu est : [:slurp] +[ok] Afficher les smiles disponibles, on peut clicker dessus pour en ajouter un dans le text +[ok] Mettre en évidence les posts auquels l'utilisateur courant à répondu ainsi que ses propres posts + * Vérifier le captcha + * Mettre un cookie +[ok] Mémoriser le pseudo et le remettre à chaque fois (si cookie) +[ok] Afficher un et pour renseigner l'utilisateur sur les différents zones de texte. Lorsque l'utilisateur click sur une zone le message disparait. (javascript). +[ok] Pouvoir répondre à un ou plusieurs messages en cliquant dessus (javascript) + * L'utilisateur peut cliquer sur un message, cela appond le nom et l'id du message à son message, exe : "kiki:G3E> " "G3E" et l'id du message en base 36, si l'id est omis alors le dernier message dont le pseudo est kiki est pris en compte + * le(s) pseudo(s) de l'auteur du message auquel on répond préfixe notre message + * Lorsque l'on passe le curseur sur un message on voit la conversation avec une mise en évidence des réponses (les messages ne faisant pas partie de la conversation sont grisés ou masqués) +[ok] Maintenir le focus sur la ligne de saisie après l'envoie d'un message +[ok] Ajouter plusieurs messages d'un coup pour eviter des lenteurs au chargement +[pas besoin] Catcher les exceptions de parsage de l'xml dans euphorik_request +[ok] Ne pas virer les balises html mais remplacer les <> par < > +[ok mais limité] Avoir accès aux archives (par page, par exemple) +[ok] Interdir les {} dans les pseudo +[plus besoin] Finir le deamon +[plus besoin] tester si le captcha_crypt existe (en regardant les fichiers images temporaires) +[ok] Virer les balises html des messages et pseudo lors du stockage du message (et trimer). +[ok] afficher les pseudo des messages auquels un message répond (modification du protocole, il faut ajouter une liste de pseudo pour chaque message) +[ok] Possibilité de logout +[ok] Filtrer les { et } dans les pseudo sur la page profile +[ok] différentier [url] [gif] [png] et le reste des url. utiliser lightbox pour les images +[ok] Déplacer le formatage des messages du coté du client -> permet de demander à lightbox de reparser lors de l'ajout d'une image +[ok] Demander une confirmation lors d'un logout (are you sure jane ?) (vie la système de messagebox) +[ok] Possibilité d'enregistrement avec une page dédiée au profil. + * Pour se logger il suffit de donner un tuple login + password (le pseudo courant de chat est une données supplémentaire). + * La css choisie est une donnée personnelle. + * Les personnes enregistrées on un pseudo d'une couleur différente. + * (Ajout de smiles personnels)? +[ok] Ajouter des messages d'erreur ("login impossible", "captcha incorrect") +[ok] Ajouter des messages systèmes +[ok] Gérer le flood : si un utilisateur envoie plus de 2 messages par seconde pendant 5 secondes alors il ne peut plus poster pendant 5 secondes + * S'il récidive alors il est suspendu pendant 5^2 puis 5^3 + * Utiliser les messages systèmes pour annonce le flood +[ok] Pouvoir modifier la css (dark/light) + * Créer le style lite + * Créer le style old (avec le style de l'ancien site) +[ok] Ne pas afficher la css dans le profile +[ok] Ne pas effacer le message (dans le ) si l'on recoit un "pas ok" lors de l'envoie +[ok] Conversations : + [ok] implémenter coté serveur et client la sauvegarde et la restauration des conversations + [ok] Supprimer l'envoie de la description des conversations lors du refresh ainsi que modifié la manière de créer les conversations (maj des diagrammes de séquence) + [ok] Navigation vers les pages précédentes + [ok] Lien vers une conversation dans les messages sous cette forme {5F}. Le clic dessus ouvre la conversation. Egalement un bouton sur chaque conversation pour insérer son lien dans le message en cours de rédaction + [ok] Mettre à jour la CSS de chaque skin +[ok] Remplacer l'XML par du JSON. gain en simplicité et en temps d'execution. + [ok] Tester sur un prototype : l'authentification -> concluant + [ok] Si concluant passage complet à JSON + [ok] Les id ne sont plus passés en base 36 + [ok] Flusher le profil lors du déchargement de la page ? -> oui + [ok] Envoyer les infos des conversations avec l'attente d'events ? -> oui +[ok] Problème de rafraichissement des couleurs des messages auquels on répond +[ok] Problème dans l'alternance des couleurs des messages +[ok] Utiliser une listbox pour la liste des css +[ok] Changer les noms des css : Light -> Cold, Old -> Classic +[ok] Faire une page faq et raconter n'importe quoi (entre autre la limitation avec firefox) "pourquoi ce site à des couleurs qui ne veulent rien dire ?" +[ok] Ralentir volontairement le connexion lors d'un mauvais login (ou après n mauvais login) +[ok] Pouvoir afficher le login et/ou le pseudo. Avoir dans le profile une liste box avec ces choix : + * pseudo + * login + * pseudo(login) +* Créer un favicon (joli) +[ok] Créer une page 'about' +[ok] Ajouter de nouveaux smiles et changer la syntax pour eviter le conflit avec totoz : + * "slurp" : http://forum-images.hardware.fr/images/perso/huit.gif + * "agreed" : http://forum-images.hardware.fr/icones/smilies/jap.gif + * "dodo" (tete avec un bonnet de nuit et des ZZZZ) + * "hum?" : http://forum-images.hardware.fr/icones/smilies/heink.gif + * "pas reveillé" avec une tasse de café et des cernes : http://forum-images.hardware.fr/images/perso/elmoricq.gif + * "interrogation" genre http://forum-images.hardware.fr/icones/confused.gif + * http://forum-images.hardware.fr/images/perso/dao.gif ou http://forum-images.hardware.fr/icones/redface.gif + * http://forum-images.hardware.fr/icones/ohwell.gif +[ok] Tester avec des caractères accentués sur Firefox, Safari, Opera et IE7. Les messages doivent être envoyés en UTF8. +[ok] Tester avec des caractères exotiques (jap, coréen, etc..) +[ok] Modifier la syntaxe des smiles actuels (pour pas qu'ils entre en conflit avec totoz) +[ok] Trouver un moyen pour éviter la création à la suite de plusieurs comptes (via register). +[ok] Restructurer le code Erlang : déplacer certaines fonctions d'un module à l'autre (ev. créer des modules) +[ok] remplacer lightbox par : http://leandrovieira.com/projects/jquery/lightbox/ +[ok] Problème des images dans les trolls +[ok] Finir l'édition (mémoriser le contenu) des trolls +[ok] Est-ce que client.dernierMessageErreur est vraiment utile ?? +[ok] marquer lors de l'affichage des login dans le chat pour les personnes n'en ayant pas : finalement il n'affiche tout simplement pas les logins +[ok] Avoir un thème de discussion affiché en haut des messages genre appellé "troll de la semaine : linux sera-t-il desktop ready en 2008?" +[ok] Un statut "EK" avec plein de privilège à la con. (avoir une petite étoile à coté de son nick ou le nick d'une certaine couleur) + * Une page "admin" avec : + * Trolls : La liste des trolls proposés. L'admin peut éditer ses propres trolls. + * Les ip bannis : avec la date d'échéance et le pseudo. Un admin peut décider de débannir un utilisateur + * Pouvoir kick/ban un user (directement depuis le chat, lors du survol du pseudo d'un user des options sont présentés sous la forme de petits boutons) + * Un kick : l'utilisateur (ip) est kické et bannis pour 15 min + * Un ban : l'utilisateur (ip) est kické et bannis pour 3 jours + * Modification de la BD -> ajouter une relation "banned_ip" +[ok] Passer à jQuery 1.2.4 +[ok] La largeur de la ligne de saisie doit corresponde à la largeur de la fenêtre +[ok] Lorsqu'un troll de la semaine est posté un message l'est également par le sys formant la racine de la conversation lié au troll + * Il est alors possible de voir la conversation lié au troll en cliquant sur le troll de la page principale +[ok] Faire des infos bulles à la facebook +[ok] Mettre les constantes au niveau du serveur dans euphorik_defines.hrl (par exemple les temps lié au flood) +[ok] Créer un style common puis adapter les CSS (classic et cold -> web2.0) + * Alignement du menu, du troll et des trolls de la partie admin à l'aide de line-height +[ok] Finir les options d'affichage des bulles et des dates +[ok] Stocker quelque part la version de la BD + * Créer une table "proprietes" contenant des tuples {propriete, nom, val} +[ok] Définir la bonne feuille de style au chargement de la page pour éviter le "clignotement" pas beau + * Le cookie envoyé par le client doit permettre de retrouver le user +[ok] Finir le script de mise en production + * Make des modules. + * Compactage des js lors de la mise en production (afin d'optimiser la bande passante lors de l'accès au site), regarder comment fait jQuery. + * Modifier le script pour virer les lignes matchant /^\W*;;.*$/ + * Virer les commentaires dans les pages HTML + * processus : + 1) copie des fichiers (+minimisation) + 2) Execution d'un scripte erlang pour recharger tous les modules au sein du noeud + 3) Executer euphorik_bd:update() pour mettre à jour la BD +[ok] Ajouter dans la FAQ et/ou dans la page d'enregistrement les conditions d'utilisation, genre "chacun est responsable de ses dires" https://linuxfr.org/bouchot/ + +=== Bugs === +1 : Critique +2 : Urgent +3 : Peu grave + +[2] Le changement de skin n'est pas mémorisé lorsque l'on est pas connecté (normal puisque le style est mémorisé dans le profil) + * solution 1 : permettre le changement de skin uniquement pour les personnes enregistré ? + * solution 2 : mémoriser le skin courant dans un cookie +[2] Après l'ajout d'une image il n'est pas possible de naviger depuis celle ci vers les autres images en utilisant Next et Prev de lightbox après l'avoir affich +[2] Plein de bugs sous MS internet explorer 7 + * click sur le lien du conv insère sont id systématiquement au début du message + * le changement de skin foire complétement +[2] griser le login dans le profil pour montrer qu'on ne peut pas l'éditer +[3] Quand on revient en arrière dans firefox le message en rédaction est perdu + * Pas sous Opera, apparemment Firefox recharge toute la page (donc impossible qu'il puisse remettre le message) + * Eventuellement sauvegarder le message en rédaction dans le profile... +[3] Le changement de page sous Firefox (pas essayé avec d'autre nav) est plutot moche, le texte est d'abors affiché puis le style est appliqué. +[3] Quelques fichiers sont encore en iso-8859-1 (Makefile, euphorik_bd.hrl, etc..) tout passer en UTF-8 +[3] Un message envoyé sans être authentifié ne sera pas taggé comme appartenant à l'utilisateur. + a) L'utilisateur attend des messages SANS donné de cookie car il n'est pas authentifié + b) L'utilisateur envoie un message + i) Il s'enregistre sans login/pass (réalisé automatiquement) + ii) Il envoie le message (put_message) + c) Le serveur réagie au nouveau message et débloque la connexion, à ce moment le serveur n'a pas le cookie car pas donné, voir a) +[3] Traiter le cas ou le cookie n'existe pas coté serveur (et plus généralement traiter tous les cas d'inputs exeptionnels) + * Afficher un message dans le cas ou le navigateur du client ne supporte pas les cookies en lui disant que la session ne pourra pas être autmatiquement restoré à la prochaine utilisation +[3] "Return" ne marche pas sous safari +[3] Le "cachage" des messages ne marche pas sous Konqueror, voir : "#page.minichat #conversations div.cache {" dans pageMinichat.css. + "-khtml-opacity: 0.3;" ne fonctionne pas +[3] Amélioration des requêtes MNESIA, voir : http://mail.google.com/mail/#label/Erlang+mailing-list/117f688280569a58 +[3] la page est completement rechargé après avoir submité le profile dans opera +[3] après le login un '?' s'ajoute à l'adresse (opera, firefox) + +[ok] Comme le json du client est encapsulé dans de l'xml il faut utiliser des xml entities pour les charactères <, > et &. Il faudrait, absolument éviter cette encapsulation moisie. +[ok] Au bout d'un moment opera n'écoute plus rien... et donc n'affiche plus les nouveaux messages.. +[ok] La méthod traiterSmiles est très lourde ! (4 secondes pour 80 appels (une page normale)) +[ok] Utiliser Alpha truc à la place d'opacity sous explorer +[ok] les heures sont formatées par le serveur avec un espace devant : " 12.30:10", zarb +[ok] un undefined est mis lorsque l'on répond à qqun qui n'a pas de pseudo (traiter ces pseudo par le formateur) +[ok] On ne peut pas réponde aux messages du système +[ok] Apparement les process liés aux connexions ne sont jamais terminé même quand l'utilisateur coupe la connexion à cause de minichat:attends_nouveau_messages() +[ok] Bug rafraichissement des conversations, exemple : + - la page 2 de la conv est affiché (mess 1 à 10) et la conv principale contient les mess de 11 à 2. + - lors de l'ajout d'un mess dans la conv celle ci n'est pas rafraichit. + - trouver une solution : donné un idDernierMess pour chaque conv ou supprimer cet idDernierMess et jouer sur le fait que l'on recoit un message après l'autre (orientation des messages après attente) +[ok] En changeant de page puis en revenant sur la page principale les smiles ne sont plus highlightés lorsque le curseur les survol + * Plus reproduit +[ok] Dans certains cas (à déterminer) les message-box (message d'information affiché tout en haut de la page) ne s'affiche plus (on ne voit que un petit bout dépassé) + * Plus reproduit +[ok] Après un register le pseudo est effacé - le pseudo n'est pas mémorisé dans le profil lors d'un envoie de mess en l'ayant changé +[ok] jQuery définit l'option "X-Requested-With" à "XMLHttpRequest dans l'entête HTTP. De ce fait Yaws exige absolument de l'xml... + Solution actuelle : jquery.js est modifié pour ne plus définir cette option. Trouver un autre moyen plus élégant. +[ok] Les smiles ne devraient pas dépasser de la fenêtre lorsqu'ils sont affichés +[ok] Les processus en attente ne se termine pas lorsque le socket est fermé (pour l'instant un timeout de 1heure est appliqué) +[ok] Possibilité d'enregistrer plusieurs users avec le même login +[ok] le return ne marche pas sous IE +[ok] Lors du click sur le bouton slap/kick/ban il faut fermer la mini fenêtre +[ok] Lors de l'extraction d'une conv il arrive que la conv extractée soit bien créée mais vide, le bouton ne ferme pas la conv (très étrange, bug de firefox?) + * Arrive une fois sur 20 environ + * Jamais reproduit avec Opera + * Peut être un bug lié à jQuery + * Reproduit sur Firefox 2 et 3 ! +[ok] Lors d'un logout il faut faire un full refresh (pour mettre à jour les messages auquel on répond par exemple) + +=== Idées === +Une fois l'idée validée elle est déplacée dans une version à venir. + +1 : A implémenter tout de suite ! +2 : A implémenter dans un futur proche +3 : Ca peut attendre +4 : A discuter +A : Abandonné +ok : Implémenté + +[1] Possibilité d'extraire une conversation, on click (par l'intermediaire d'un petit bouton par exemple) sur un message et l'arbre de réponses correspondant s'affiche dans une colonne sur la gauche. + * Il est possible d'ouvrir plusieurs conversations + * Les messages faisant partie des conversations ne sont plus visibles dans le flux général + * (une colonne peut avoir le focus, dans ce cas on répond automatiquement à la dernière personne qui nous a répondu) + * Chaque colonne possède une entête avec le message d'origine et trois boutons : + * un pour copier l'id de la conversation dans la textbox (voir point suivant) + * un pour fermer la conversation + * un pour créer une url vers cette conversation (un peu à la manière de google maps) +[2] Raccourcis pour répondre aux conversations (genre CTRL+2 pour répondre au deuxième) +[2] Syntaxe avancée des messagees : + * Possibilité d'utiliser les balises , , , (quoted text) + * Utiliser la syntaxe de mediaWiki + * La balise pour mettre des spoilers +[2] Une option dans le profile pour se délogger automatiquement lorsque l'on quitte le site +[2] Pouvoir cacher les dates +[3] Gestion de l'historique (calendrier) +[3] Idée de bernie : + * Pouvoir STFUER des personnes, lorsqu'elle envoie un message un autre truc à la con est écrit à la place + * la phrase à la con est piché parmis une liste éditable depuis le panneau d'admin + * La stfuation se fait depuis le panel de bannissement (slap, stfu, kick, ban) +[4] Unifier tout le code en anglais (sauf les commentaires) +[4] Inscrire le nom de l'image dans les les liens vers des images (à la place de simplement [jpg] ou [gif]) +[4] Réduire les pseudos trop long en mettant un ".." à la fin et permettre de le voir en entier lorsque le curseur le survol. +[4] Compatible OpenID pour l'identification +[4] Outil de localisation des personnes un peu comme ca : http://bouchot.org/cps +[4] Pouvoir voir le profile des personnes. + * Voir leurs derniers messages + * Une page de recherche de personne +[4] Chaque user possède un Blog (ne pas utiliser le terme 'Blog') Dans lequel il peut poster des "Troll", sorte de "sujet" de forum. + * Ce système est utilisé dans le chat principal (avec le troll de la semaine posté par un admin). + * Chaque troll possède un certain nombre de tag. + * il est possible de faire une recherche sur l'ensemble des users. + * Voir description.txt pour plus d'info sur les trolls +[4] Pouvoir privatiser une conversation entre 2 ou plusieurs personnes +[4] Pouvoir choisir une couleur pour son pseudo +[4] Créer un gamebot pour lancer des jeux + * Définir une interface pour la création de nouveau jeu au sein du serveur + * Jeu d'énigmes + * jeu du pendu + * Jeu des chiffres et des lettres : "[Lettres tirées] - E N X U L S Z C M I - (trouvez le mot de plus long avec ces lettres)" +[4] Image animée à la http://www.google.co.kr/ cf http://www.google.co.kr//ig/f/AaEyQnOaAr4/intl/ALL_kr/svc_sprite_all.gif +[4] Bot de traduction +[4] RSS +[4] Système de vote sur les messages, + ou - qui donne des points aux messages... +[4] Voir les personnes connectées + un statut +[4] Avoir une liste d'amis +[4] Restreindre la consultation d'un message posté à un ou plusieurs utilisateurs définis. Les messages de la conversation ne sont alors vus que par cet ensemble d'utilisateurs. +[4] Système de trolls. Voir decription.txt. + +[A] smiles personnalisés, on peut en ajouter dans la préférence utilisateur. +[ok] Pouvoir insérer des tags qui sont des liens vers des conversations, par exemple : {R4S} =~ /\{\w+\}/ + + +=== Concurrents === +http://www.phpfreechat.net/demo.fr.html +http://moules.org/board +http://hadoken.free.fr/board/index#b +http://bouchot.org/tribune#missive +https://linuxfr.org/board/ diff --git a/doc/description.txt b/doc/description.txt new file mode 100644 index 0000000..a91e228 --- /dev/null +++ b/doc/description.txt @@ -0,0 +1,109 @@ +== En bref == +Euphorik est un site web communautaire principalement basé sur un système d'échange de messages instantanés. +Attention: la description ici ne correspond pas à l'état actuel du projet mais à un but à atteindre. + +== Philosophie == +Euphorik est un site communaire de niveau supérieur (un truc qui n'existe pas et qui n'existera probablement jamais). +N'importe qui peut poster des messages ou des trolls (un troll étant un super message persistant à caractère trollifique). +Il est possible de s'enregistrer pour garder son identité et sauvegarder certains paramètres. +Pas besoin d'être authentifier pour poster des messages +Il faut être enregistré pour poster des trolls (ouais bein quant on troll on assume) +Il n'y a qu'un seul canal par troll (channel au sens IRC). +Un message peut répondre à un ou plusieurs autres messages, ceci crée automatiquement des arbres de conversation (au sein d'un troll). +Ces arbres de conversation peuvent être extraient de la conversation principal et affichés séparement (toujours au sein d'un troll). +Il existe des êtres supérieures qui ont de grands pouvoirs, ce sont les EkMaster ou [EM] (les admins quoi). +L'interface doit être sobre, simple et un peu retro :) +Il est interdit d'utiliser des technos pourries comme PHP. + + +== Détails == +=== Pages === +* Main : Présente les trolls de la semaine +* Trolls : Liste un certain nombre de trolls postés par les utilisateurs. Le rafraichissement est en temps réel. Il est possible de faire une recherche par mot clef. +* People : Permet de rechercher une personne et d'afficher sa page, en particulier ses trolls. +* Profile : Permet d'accèder à ses données. C'est à partir de cette page que l'on peut poster des trolls. +* About : description du site (Faq et cie..) + +=== Le Troll === +Le troll est un message, une question, une pensée, etc, digne d'intérêt (ou pas) étant la fusion entre un topic de forum et un channel de chat. +Il existe un troll principal concernant le chat principal. +Un troll peut être édité par son auteur. +N'importe qui peut voir l'historique des éditions. +Il est possible de plusser ou moinsser un troll. +Un troll possède de 0 à n tag (mot-clef). +Les trolls sont présentés au sein d'une liste général ordrée en fonction de leur nombre de point et de leur date et aussi tant qu'on y est de la date du dernier message (genre reddit.com) +Les trolls sont également présentés sur le profile du proprio du troll (par ordre anti-chronologique) + +=== Le troll de la semaine === +Sur la page principale appelé 'chat' il existe un troll qui sera affiché une semaine appellé "troll de la semaine". +Le troll de la semaine est posté par les admins. +Les admins voient les prochains trolls en attente, le nombre en attente est limité 10. +Un admin peut ajouter un troll de la semaine. Il ne peut pas posséder plus d'un troll en attente. +Le troll de la semaine change le lundi à 3h00 du mat' s'il en existe un en attente. Il est choisi au hasard. +Les n derniers trolls des semaines précédentes sont toujours affichés de manière repliés en dessous du troll de la semaine. pour l'instant n = 4. + +=== Le message === +Un message répond à un troll et peut répondre à d'autres messages de ce troll. +Un message ne peut pas être éditer, il est possible de lui appondre une ou plusieurs corrections " +++ Correction" + + +=== Admin === +L'admin propose des trolls de la semaine, il a le statut de EM (EkMaster) + + +== Reflexions == +Les types d'information du plus éphémère au plus persistant. + * Plussage/moinssage + * Message + * Message (1-1) + * Blog + * Forum + * Article + * Question (1-1) | (1-n) + * Forum + * Message + * Billet (1-n) + * Blog + * Article (1-n) | (n-n) + * Wikipedia + + +Moyen de communication sur le net : + +* Réseaux sociaux (facebook et cie) + + Orienté profile + + Liste d'amis + + Possibilité de mettre des infos personnels + photos + +* Vidéo (youtube et cie) + + Orienté vidéo + +* Reddit/Digg + * Aggrégateur de news/billet de blog/article + * L'ordre des informations peut changer (en fonction de la note) + +* Blog + * Orienté billet + * Géré par une seule personne + * Système de messages + + Structuration et recherche par tag (chaque billet possède un ou plusieurs tags) + +* Forum (phpBB, vBulettin, mesDiscussions, etc.) + * Orienté sujet + * Organisation hiérachique en thémes, p.e. : Hardware/HDD + * L'ordre des sujets ne correspond pas à leur date d'écriture mais à la date du dernier message + * Edition/correction possible + * Les "réponses" ne sont pas modérer par l'auteur du sujet + - Pas de système de plussage + - Par forcément d'arbre de réponses, obligation de quoter -> bordelique + - Le topic a souvent tendance à dériver + +* Chat (http://www.phpfreechat.net, http://bouchot.org, etc..) + * Orienté message + * Ordre figé + + Scalable grace aux channels + + Communication temps réel + - Ca peut devenir le bordel, difficile de suivre + - L'information est éphemère ou difficilement réutilisable + - Aucune hiérarchie ou structure en dehors des channels + \ No newline at end of file diff --git a/doc/graphiques/bouton_smiles.xcf b/doc/graphiques/bouton_smiles.xcf new file mode 100644 index 0000000..21ac57a Binary files /dev/null and b/doc/graphiques/bouton_smiles.xcf differ diff --git a/doc/graphiques/fond.xcf b/doc/graphiques/fond.xcf new file mode 100755 index 0000000..96e905f Binary files /dev/null and b/doc/graphiques/fond.xcf differ diff --git a/doc/graphiques/fond2.xcf b/doc/graphiques/fond2.xcf new file mode 100644 index 0000000..902ba65 Binary files /dev/null and b/doc/graphiques/fond2.xcf differ diff --git a/doc/graphiques/fond3.xcf b/doc/graphiques/fond3.xcf new file mode 100644 index 0000000..33cf542 Binary files /dev/null and b/doc/graphiques/fond3.xcf differ diff --git a/doc/graphiques/icones/ban.xcf b/doc/graphiques/icones/ban.xcf new file mode 100644 index 0000000..5819921 Binary files /dev/null and b/doc/graphiques/icones/ban.xcf differ diff --git a/doc/graphiques/icones/exclamation.xcf b/doc/graphiques/icones/exclamation.xcf new file mode 100755 index 0000000..96381e0 Binary files /dev/null and b/doc/graphiques/icones/exclamation.xcf differ diff --git a/doc/graphiques/icones/fermer.xcf b/doc/graphiques/icones/fermer.xcf new file mode 100755 index 0000000..9dc1f7b Binary files /dev/null and b/doc/graphiques/icones/fermer.xcf differ diff --git a/doc/graphiques/icones/information.xcf b/doc/graphiques/icones/information.xcf new file mode 100755 index 0000000..a44fedb Binary files /dev/null and b/doc/graphiques/icones/information.xcf differ diff --git a/doc/graphiques/icones/interrogation.xcf b/doc/graphiques/icones/interrogation.xcf new file mode 100755 index 0000000..8b7cfd8 Binary files /dev/null and b/doc/graphiques/icones/interrogation.xcf differ diff --git a/doc/graphiques/icones/kick.xcf b/doc/graphiques/icones/kick.xcf new file mode 100644 index 0000000..569ef77 Binary files /dev/null and b/doc/graphiques/icones/kick.xcf differ diff --git a/doc/graphiques/icones/slap.xcf b/doc/graphiques/icones/slap.xcf new file mode 100644 index 0000000..ef1af5d Binary files /dev/null and b/doc/graphiques/icones/slap.xcf differ diff --git a/doc/graphiques/logo.png b/doc/graphiques/logo.png new file mode 100644 index 0000000..cb5fe32 Binary files /dev/null and b/doc/graphiques/logo.png differ diff --git a/doc/graphiques/logo_1.xcf b/doc/graphiques/logo_1.xcf new file mode 100755 index 0000000..f4993a8 Binary files /dev/null and b/doc/graphiques/logo_1.xcf differ diff --git a/doc/graphiques/logo_2.xcf b/doc/graphiques/logo_2.xcf new file mode 100755 index 0000000..dc069c9 Binary files /dev/null and b/doc/graphiques/logo_2.xcf differ diff --git a/doc/graphiques/maquette_1.svg b/doc/graphiques/maquette_1.svg new file mode 100644 index 0000000..f7f1a98 --- /dev/null +++ b/doc/graphiques/maquette_1.svg @@ -0,0 +1,581 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + [16:57:11] Pifou + What is your favourite colour ? + + + [16:57:11] Pifou + What is your favourite colour ? + + [16:57:11] Pifou + What is your favourite colour ? + + + + + + + + + + dpi : 138.64 + + + + + + + + + + euphorik + + + + + + + chat + profile + about + + troll de la semaine : + + + + diff --git a/doc/graphiques/old.xcf b/doc/graphiques/old.xcf new file mode 100755 index 0000000..ac44d56 Binary files /dev/null and b/doc/graphiques/old.xcf differ diff --git a/doc/graphiques/old_piedpage.xcf b/doc/graphiques/old_piedpage.xcf new file mode 100755 index 0000000..9975be0 Binary files /dev/null and b/doc/graphiques/old_piedpage.xcf differ diff --git a/doc/graphiques/path2383.png b/doc/graphiques/path2383.png new file mode 100644 index 0000000..6313230 Binary files /dev/null and b/doc/graphiques/path2383.png differ diff --git a/doc/graphiques/return.xcf b/doc/graphiques/return.xcf new file mode 100755 index 0000000..086db3a Binary files /dev/null and b/doc/graphiques/return.xcf differ diff --git a/doc/installation.txt b/doc/installation.txt new file mode 100644 index 0000000..4f71285 --- /dev/null +++ b/doc/installation.txt @@ -0,0 +1,79 @@ +-- Description de l'installation de Euphorik -- + +Voici les différentes étapes décrivant l'installation du site euphorik. Certaines données sont a adaptées en fonction des besoins. L'installation est décrite pour le système d'exploitation Debian. + +* On admet que le dossier de base est "/euphorik". +* On admet que l'utilisateur courant est "toto" et qu'il possède "/euphorik" +* Tout ce qui commence par un '$' correspond à une ligne de commande tapée dans le shell de l'OS. +* Tout ce qui commence par un '>' correspond à une instruction dans le shell de erlang. + + +1. Installer Yaws + a) $apt-get install yaws + +2. Configurer Yaws + a) Ajouter les lignes suivantes dans /etc/yaws/yaws.conf : + - "ebin_dir = /euphorik/modules/ebin" + - "include_dir = /euphorik/modules/include" + b) Le serveur virtuel est définit comme ceci dans /etc/yaws/conf.d/localhost.conf : + + port = 8081 + listen = 0.0.0.0 + docroot = /euphorik + allowed_scripts = [yaws] + appmods = + start_mod = euphorik_daemon + + c) Editer '/etc/init.d/yaws' et remplacer cette ligne : + script="$DAEMON -I $YAWS_ID $@" + par celle ci : + script="$DAEMON --sname yaws --mnesiadir \"/euphorik/BD\" -I $YAWS_ID $@" + FIXME : trouver une méthode plus élégante. + +3. Créer la base de donnée + a) Arreter Yaws (en root) : + $/etc/init.s/yaws stop + b) Lancer un noeud Erlang + - Se placer dans le répertoire /euphorik/modules/ebin + - Executer : + $erl -sname yaws -mnesia dir '"/euphorik/BD"' + c) Charger le module : + >l(euphorik_bd). + d) Créer la base : + >euphorik_bd:create(). + e) Démarrer Yaws (en root) : + $/etc/init.s/yaws start + +4. Adminisatration du site Euphorik + a) Connexion au noeud "yaws" + erl -sname gb + puis dans la console : + CTRL-G + r yaws@overnux + c 2 + Pour plus d'infos : http://www.ejabberd.im/interconnect-erl-nodes + Il est possible de connecter un shell directement sur le noeud de yaws comme ceci : + erl -sname gb -remsh yaws@overnux + + b) Utiliser les outils des modules + - Par exemple : + >euphorik_minichat:messages(10). + pour voir les 10 derniers messages + + c) Ancienne méthode de connexion (plus compliqué) + - Le cookie de Yaws (/var/run/yaws/.erlang.cookie ou /var/cache/yaws/.erlang.cookie) et celui de l'utilisateur courant (~/.erlang.cookie) doit être le même. + (si le cookie de yaws est modifié il faut relancer yaws). + - Se placer dans le répertoire /euphorik/modules/ebin + - Executer : + $erl -sname toto + où "toto" est le nom du noeud (tout sauf "yaws") + - Charger le module du minichat : + >l(euphorik_minichat) + - Se connecter au noeud yaws : + >euphorik_minichat:connect() + la valeur retournée doit être : {ok,[yaws@overnux]} + + d) Informations sur la mémoire consommée : + Mémoire totale (ko) : + trunc(element(2, lists:nth(1, memory())) / 1024). + voir c:i() également diff --git a/doc/profiling/JavaScript Profile Data 2008-04-15.html b/doc/profiling/JavaScript Profile Data 2008-04-15.html new file mode 100644 index 0000000..83ed63c --- /dev/null +++ b/doc/profiling/JavaScript Profile Data 2008-04-15.html @@ -0,0 +1,2199 @@ + +JavaScript Profile Data + + + + +

JavaScript Profile Data

+ Collection Date: + Wed Apr 16 2008 01:35:42 GMT+0200 (CEST)
+ User Agent: + Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 Iceweasel/2.0.0.13 (Debian-2.0.0.13-1)
+ JavaScript Debugger Version: + Venkman 0.9.87.3 [Mozilla rv:1.8.1.13/2]
+ Sorted By: + total
+ +
+ + +

chrome://global/content/bindings/browser.xml

+ + + +

0.09 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + chrome://global/content/bindings/browser.xml
+ onxblmouseup: +889-895, 1 call(s), 0.09ms total, 0.09ms min, 0.09ms max, 0.09ms avg, +excluding calls: 0.09ms total, 0.09ms min, 0.09ms max, 0.09ms avg +
+ + + +
+ + + + 1 + chrome://global/content/bindings/browser.xml
+ onxblmousedown: +897-916, 1 call(s), 0.05ms total, 0.05ms min, 0.05ms max, 0.05ms avg, +excluding calls: 0.05ms total, 0.05ms min, 0.05ms max, 0.05ms avg +
+ + + +
+
+
+
+
+ + +

chrome://global/content/bindings/button.xml

+ + + +

0.14 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + chrome://global/content/bindings/button.xml
+ onxblcommand: +127-134, 1 call(s), 0.14ms total, 0.14ms min, 0.14ms max, 0.14ms avg, +excluding calls: 0.14ms total, 0.14ms min, 0.14ms max, 0.14ms avg +
+ + + +
+
+
+
+
+ + +

file:/usr/lib/iceweasel/components/nsMicrosummaryService.js

+ + + +

0.5 - 0.75 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ anonymous: +205-206, 2 call(s), 0.65ms total, 0.22ms min, 0.43ms max, 0.32ms avg, +excluding calls: 0.02ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+ + + + 1 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ MSS__updateMicrosummaries: +219-244, 2 call(s), 0.62ms total, 0.21ms min, 0.42ms max, 0.31ms avg, +excluding calls: 0.05ms total, 0.02ms min, 0.03ms max, 0.02ms avg +
+ + + +
+
+ + +

0.25 - 0.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 2 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ MSS__getBookmarks: +606-626, 2 call(s), 0.4ms total, 0.14ms min, 0.26ms max, 0.2ms avg, +excluding calls: 0.21ms total, 0.07ms min, 0.14ms max, 0.11ms avg +
+ + + +
+
+ + +

0.18 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 3 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ anonymous: +159-164, 2 call(s), 0.18ms total, 0.06ms min, 0.13ms max, 0.09ms avg, +excluding calls: 0.03ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+ + + + 4 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ MSS__resource: +134-136, 4 call(s), 0.18ms total, 0.02ms min, 0.07ms max, 0.04ms avg, +excluding calls: 0.16ms total, 0.02ms min, 0.07ms max, 0.04ms avg +
+ + + +
+ + + + 5 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ getPref: +2233-2247, 2 call(s), 0.16ms total, 0.05ms min, 0.11ms max, 0.08ms avg, +excluding calls: 0.16ms total, 0.05ms min, 0.11ms max, 0.08ms avg +
+ + + +
+ + + + 6 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ anonymous: +84-88, 2 call(s), 0.01ms total, 0ms min, 0.01ms max, 0ms avg, excluding +calls: 0.01ms total, 0ms min, 0.01ms max, 0ms avg +
+ + + +
+ + + + 7 + file:/usr/lib/iceweasel/components/nsMicrosummaryService.js
+ anonymous: +75-80, 4 call(s), 0.01ms total, 0ms min, 0.01ms max, 0ms avg, excluding +calls: 0.01ms total, 0ms min, 0.01ms max, 0ms avg +
+ + + +
+
+
+
+
+ + +

http://localhost:8080/js/euphorik.js

+ + + +

500 - 750 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + http://localhost:8080/js/euphorik.js
+ anonymous: +821-843, 29 call(s), 668.35ms total, 5.23ms min, 146.36ms max, 23.05ms +avg, excluding calls: 2.41ms total, 0.05ms min, 0.1ms max, 0.08ms avg +
+ + + +
+
+ + +

250 - 500 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 1 + http://localhost:8080/js/euphorik.js
+ anonymous: +464-479, 15 call(s), 412.6ms total, 14.67ms min, 146.37ms max, 27.51ms +avg, excluding calls: 0.15ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+ + + + 2 + http://localhost:8080/js/euphorik.js
+ anonymous: +451-457, 14 call(s), 256.03ms total, 5.24ms min, 21.69ms max, 18.29ms +avg, excluding calls: 0.13ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+
+ + +

100 - 250 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 3 + http://localhost:8080/js/euphorik.js
+ anonymous: +301-303, 1538 call(s), 235.74ms total, 0.13ms min, 0.65ms max, 0.15ms +avg, excluding calls: 18.14ms total, 0.01ms min, 0.03ms max, 0.01ms avg +
+ + + +
+ + + + 4 + http://localhost:8080/js/euphorik.js
+ anonymous: +309-317, 1538 call(s), 185.68ms total, 0.1ms min, 0.62ms max, 0.12ms +avg, excluding calls: 185.68ms total, 0.1ms min, 0.62ms max, 0.12ms avg +
+ + + +
+
+ + +

75 - 100 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 5 + http://localhost:8080/js/euphorik.js
+ anonymous: +586-634, 29 call(s), 80.97ms total, 0.97ms min, 4.52ms max, 2.79ms avg, +excluding calls: 43.25ms total, 0.6ms min, 2.47ms max, 1.49ms avg +
+ + + +
+
+ + +

50 - 75 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 6 + http://localhost:8080/js/euphorik.js
+ anonymous: +129-150, 87 call(s), 64.45ms total, 0.24ms min, 2.81ms max, 0.74ms avg, +excluding calls: 56.97ms total, 0.24ms min, 1.98ms max, 0.65ms avg +
+ + + +
+
+ + +

10 - 25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 7 + http://localhost:8080/js/euphorik.js
+ anonymous: +325-340, 1538 call(s), 21.82ms total, 0.01ms min, 0.49ms max, 0.01ms +avg, excluding calls: 21.82ms total, 0.01ms min, 0.49ms max, 0.01ms avg +
+ + + +
+ + + + 8 + http://localhost:8080/js/euphorik.js
+ anonymous: +153-156, 87 call(s), 12.08ms total, 0.06ms min, 0.26ms max, 0.14ms avg, +excluding calls: 1.7ms total, 0.01ms min, 0.05ms max, 0.02ms avg +
+ + + +
+ + + + 9 + http://localhost:8080/js/euphorik.js
+ anonymous: +120-125, 87 call(s), 10.37ms total, 0.05ms min, 0.22ms max, 0.12ms avg, +excluding calls: 10.37ms total, 0.05ms min, 0.22ms max, 0.12ms avg +
+ + + +
+ + + + 10 + http://localhost:8080/js/euphorik.js
+ anonymous: +320-322, 1538 call(s), 10.09ms total, 0.01ms min, 0.02ms max, 0.01ms +avg, excluding calls: 10.09ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+
+ + +

0.25 - 0.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 11 + http://localhost:8080/js/euphorik.js
+ anonymous: +662-664, 58 call(s), 0.3ms total, 0ms min, 0.01ms max, 0.01ms avg, +excluding calls: 0.3ms total, 0ms min, 0.01ms max, 0.01ms avg +
+ + + +
+
+ + +

0.07 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 12 + http://localhost:8080/js/euphorik.js
+ anonymous: +836-837, 29 call(s), 0.07ms total, 0ms min, 0ms max, 0ms avg, excluding +calls: 0.07ms total, 0ms min, 0ms max, 0ms avg +
+ + + +
+
+
+
+
+ + +

http://localhost:8080/js/jquery.js

+ + + +

5000 - 1000000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + http://localhost:8080/js/jquery.js
+ anonymous: +28-30, 19234 call(s), 5693.38ms total, 0.01ms min, 216.95ms max, 0.3ms +avg, excluding calls: 464.46ms total, 0.01ms min, 24.31ms max, 0.02ms +avg +
+ + + +
+ + + + 1 + http://localhost:8080/js/jquery.js
+ success: +29-30, 58 call(s), 5215.49ms total, 0.05ms min, 216.65ms max, 89.92ms +avg, excluding calls: 2.42ms total, 0.02ms min, 0.07ms max, 0.04ms avg +
+ + + +
+ + + + 2 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 3278 call(s) (max depth 2), 5030.7ms total, 0ms min, 184.61ms +max, 1.53ms avg, excluding calls: 0.39ms total, 0ms min, 0.02ms max, +0ms avg +
+ + + +
+ + + + 3 + http://localhost:8080/js/jquery.js
+ anonymous: +20-23, 13022 call(s) (max depth 3), 5030.3ms total, 0ms min, 184.61ms +max, 0.39ms avg, excluding calls: 6.27ms total, 0ms min, 0.27ms max, +0ms avg +
+ + + +
+
+ + +

2500 - 5000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 4 + http://localhost:8080/js/jquery.js
+ anonymous: +11-12, 22974 call(s) (max depth 1), 2960.77ms total, 0ms min, 8.68ms +max, 0.13ms avg, excluding calls: 76.34ms total, 0ms min, 0.4ms max, +0ms avg +
+ + + +
+ + + + 5 + http://localhost:8080/js/jquery.js
+ anonymous: +11-14, 22974 call(s) (max depth 1), 2884.44ms total, 0ms min, 8.66ms +max, 0.13ms avg, excluding calls: 288.02ms total, 0ms min, 0.95ms max, +0.01ms avg +
+ + + +
+ + + + 6 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 6410 call(s), 2564.3ms total, 0.15ms min, 8.55ms max, 0.4ms avg, +excluding calls: 118.22ms total, 0.01ms min, 0.51ms max, 0.02ms avg +
+ + + +
+
+ + +

1000 - 2500 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 7 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 6410 call(s), 2189.28ms total, 0.11ms min, 8.37ms max, 0.34ms +avg, excluding calls: 178.97ms total, 0.02ms min, 0.79ms max, 0.03ms avg +
+ + + +
+ + + + 8 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 6410 call(s), 2010.3ms total, 0.08ms min, 8.32ms max, 0.31ms +avg, excluding calls: 55.71ms total, 0.01ms min, 0.48ms max, 0.01ms avg +
+ + + +
+ + + + 9 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 6410 call(s), 1954.59ms total, 0.08ms min, 8.3ms max, 0.3ms avg, +excluding calls: 867.58ms total, 0.07ms min, 1.46ms max, 0.14ms avg +
+ + + +
+ + + + 10 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 89 call(s), 1051.59ms total, 1.58ms min, 153.35ms max, 11.82ms +avg, excluding calls: 3.74ms total, 0.02ms min, 0.19ms max, 0.04ms avg +
+ + + +
+ + + + 11 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 91 call(s) (max depth 1), 1047.85ms total, 0ms min, 153.29ms +max, 11.51ms avg, excluding calls: 9.83ms total, 0ms min, 0.63ms max, +0.11ms avg +
+ + + +
+
+ + +

750 - 1000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 12 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 697 call(s) (max depth 1), 838.45ms total, 0.01ms min, 20.04ms +max, 1.2ms avg, excluding calls: 5.83ms total, 0.01ms min, 0.03ms max, +0.01ms avg +
+ + + +
+ + + + 13 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 522 call(s), 788.81ms total, 1.39ms min, 2.56ms max, 1.51ms avg, +excluding calls: 125.21ms total, 0.21ms min, 1.17ms max, 0.24ms avg +
+ + + +
+
+ + +

500 - 750 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 14 + http://localhost:8080/js/jquery.js
+ anonymous: +25-27, 14270 call(s), 744.55ms total, 0ms min, 4.88ms max, 0.05ms avg, +excluding calls: 744.55ms total, 0ms min, 4.88ms max, 0.05ms avg +
+ + + +
+ + + + 15 + http://localhost:8080/js/jquery.js
+ anonymous: +28-30, 87 call(s), 701.52ms total, 1.11ms min, 143.5ms max, 8.06ms avg, +excluding calls: 627.27ms total, 0.87ms min, 141.92ms max, 7.21ms avg +
+ + + +
+ + + + 16 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 3770 call(s), 534.93ms total, 0.12ms min, 1.41ms max, 0.14ms +avg, excluding calls: 66.08ms total, 0.01ms min, 0.52ms max, 0.02ms avg +
+ + + +
+
+ + +

250 - 500 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 17 + http://localhost:8080/js/jquery.js
+ anonymous: +18-19, 116 call(s), 445.58ms total, 0.32ms min, 9.1ms max, 3.84ms avg, +excluding calls: 1.82ms total, 0.01ms min, 0.02ms max, 0.02ms avg +
+ + + +
+ + + + 18 + http://localhost:8080/js/jquery.js
+ anonymous: +18-19, 116 call(s), 443.77ms total, 0.31ms min, 9.09ms max, 3.83ms avg, +excluding calls: 14.32ms total, 0.08ms min, 0.64ms max, 0.12ms avg +
+ + + +
+ + + + 19 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 58 call(s), 426.41ms total, 6.36ms min, 9.12ms max, 7.35ms avg, +excluding calls: 0.54ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+ + + + 20 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 3712 call(s), 421.99ms total, 0.1ms min, 1.37ms max, 0.11ms avg, +excluding calls: 291.84ms total, 0.07ms min, 1.27ms max, 0.08ms avg +
+ + + +
+ + + + 21 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 3132 call(s), 421.68ms total, 0.06ms min, 0.98ms max, 0.13ms +avg, excluding calls: 68.25ms total, 0.02ms min, 0.49ms max, 0.02ms avg +
+ + + +
+ + + + 22 + http://localhost:8080/js/jquery.js
+ anonymous: +26-28, 4176 call(s) (max depth 1), 335.54ms total, 0.04ms min, 0.95ms +max, 0.08ms avg, excluding calls: 165.83ms total, 0.02ms min, 0.88ms +max, 0.04ms avg +
+ + + +
+ + + + 23 + http://localhost:8080/js/jquery.js
+ anonymous: +18-19, 580 call(s), 280.49ms total, 0.11ms min, 1.25ms max, 0.48ms avg, +excluding calls: 24.47ms total, 0.03ms min, 0.07ms max, 0.04ms avg +
+ + + +
+ + + + 24 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 7512 call(s), 272.46ms total, 0.03ms min, 0.61ms max, 0.04ms +avg, excluding calls: 146.73ms total, 0.01ms min, 0.59ms max, 0.02ms avg +
+ + + +
+
+ + +

100 - 250 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 25 + http://localhost:8080/js/jquery.js
+ anonymous: +19-20, 352 call(s) (max depth 1), 245.22ms total, 0.06ms min, 5.42ms +max, 0.7ms avg, excluding calls: 245.22ms total, 0.06ms min, 5.42ms +max, 0.7ms avg +
+ + + +
+ + + + 26 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 349 call(s), 244.7ms total, 0.57ms min, 4.03ms max, 0.7ms avg, +excluding calls: 244.7ms total, 0.57ms min, 4.03ms max, 0.7ms avg +
+ + + +
+ + + + 27 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 2178 call(s), 238.1ms total, 0.09ms min, 0.64ms max, 0.11ms avg, +excluding calls: 46.53ms total, 0.02ms min, 0.5ms max, 0.02ms avg +
+ + + +
+ + + + 28 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 91 call(s), 227.57ms total, 0.56ms min, 5.52ms max, 2.5ms avg, +excluding calls: 5.5ms total, 0.03ms min, 0.21ms max, 0.06ms avg +
+ + + +
+ + + + 29 + http://localhost:8080/js/jquery.js
+ anonymous: +24-25, 2178 call(s), 185.48ms total, 0.05ms min, 0.62ms max, 0.09ms +avg, excluding calls: 109.63ms total, 0.04ms min, 0.57ms max, 0.05ms avg +
+ + + +
+ + + + 30 + http://localhost:8080/js/jquery.js
+ anonymous: +28-29, 1044 call(s), 182.47ms total, 0.14ms min, 0.38ms max, 0.17ms +avg, excluding calls: 4.97ms total, 0ms min, 0.06ms max, 0ms avg +
+ + + +
+ + + + 31 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 1044 call(s), 177.5ms total, 0.14ms min, 0.38ms max, 0.17ms avg, +excluding calls: 14.07ms total, 0.01ms min, 0.04ms max, 0.01ms avg +
+ + + +
+ + + + 32 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 1044 call(s), 163.43ms total, 0.13ms min, 0.36ms max, 0.16ms +avg, excluding calls: 16.88ms total, 0.01ms min, 0.05ms max, 0.02ms avg +
+ + + +
+ + + + 33 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 1044 call(s), 146.55ms total, 0.11ms min, 0.35ms max, 0.14ms +avg, excluding calls: 70.49ms total, 0.05ms min, 0.16ms max, 0.07ms avg +
+ + + +
+ + + + 34 + http://localhost:8080/js/jquery.js
+ anonymous: +23-25, 116 call(s), 142.21ms total, 0.06ms min, 3.1ms max, 1.23ms avg, +excluding calls: 3.77ms total, 0.03ms min, 0.06ms max, 0.03ms avg +
+ + + +
+ + + + 35 + http://localhost:8080/js/jquery.js
+ anonymous: +23-25, 116 call(s), 138.44ms total, 0.03ms min, 3.07ms max, 1.19ms avg, +excluding calls: 117.14ms total, 0.03ms min, 2.68ms max, 1.01ms avg +
+ + + +
+ + + + 36 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 3712 call(s), 130.15ms total, 0.03ms min, 0.82ms max, 0.04ms +avg, excluding calls: 130.15ms total, 0.03ms min, 0.82ms max, 0.04ms avg +
+ + + +
+ + + + 37 + http://localhost:8080/js/jquery.js
+ anonymous: +20-21, 11452 call(s), 116.35ms total, 0ms min, 0.43ms max, 0.01ms avg, +excluding calls: 116.35ms total, 0ms min, 0.43ms max, 0.01ms avg +
+ + + +
+
+ + +

75 - 100 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 38 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 134 call(s), 92.03ms total, 0.03ms min, 1.92ms max, 0.69ms avg, +excluding calls: 10ms total, 0.02ms min, 0.76ms max, 0.07ms avg +
+ + + +
+ + + + 39 + http://localhost:8080/js/jquery.js
+ anonymous: +14-15, 58 call(s), 88.93ms total, 1.33ms min, 2.04ms max, 1.53ms avg, +excluding calls: 1.13ms total, 0.02ms min, 0.03ms max, 0.02ms avg +
+ + + +
+ + + + 40 + http://localhost:8080/js/jquery.js
+ anonymous: +19-20, 2643 call(s), 87.88ms total, 0.01ms min, 0.56ms max, 0.03ms avg, +excluding calls: 87.88ms total, 0.01ms min, 0.56ms max, 0.03ms avg +
+ + + +
+ + + + 41 + http://localhost:8080/js/jquery.js
+ anonymous: +15-16, 1044 call(s), 83.2ms total, 0.06ms min, 0.58ms max, 0.08ms avg, +excluding calls: 20.65ms total, 0.01ms min, 0.37ms max, 0.02ms avg +
+ + + +
+ + + + 42 + http://localhost:8080/js/jquery.js
+ anonymous: +14-15, 522 call(s), 76.31ms total, 0.14ms min, 0.5ms max, 0.15ms avg, +excluding calls: 3.33ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+
+ + +

50 - 75 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 43 + http://localhost:8080/js/jquery.js
+ anonymous: +26-28, 1044 call(s), 70.63ms total, 0.06ms min, 0.14ms max, 0.07ms avg, +excluding calls: 64.65ms total, 0.05ms min, 0.13ms max, 0.06ms avg +
+ + + +
+ + + + 44 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 522 call(s), 70.11ms total, 0.11ms min, 0.67ms max, 0.13ms avg, +excluding calls: 70.11ms total, 0.11ms min, 0.67ms max, 0.13ms avg +
+ + + +
+ + + + 45 + http://localhost:8080/js/jquery.js
+ anonymous: +24-25, 8268 call(s), 67.22ms total, 0ms min, 0.67ms max, 0.01ms avg, +excluding calls: 67.22ms total, 0ms min, 0.67ms max, 0.01ms avg +
+ + + +
+ + + + 46 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 8150 call(s), 64.81ms total, 0.01ms min, 0.06ms max, 0.01ms avg, +excluding calls: 64.81ms total, 0.01ms min, 0.06ms max, 0.01ms avg +
+ + + +
+ + + + 47 + http://localhost:8080/js/jquery.js
+ anonymous: +19-20, 8324 call(s), 56.71ms total, 0ms min, 0.52ms max, 0.01ms avg, +excluding calls: 56.71ms total, 0ms min, 0.52ms max, 0.01ms avg +
+ + + +
+ + + + 48 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 1044 call(s), 55.43ms total, 0.04ms min, 0.25ms max, 0.05ms avg, +excluding calls: 55.43ms total, 0.04ms min, 0.25ms max, 0.05ms avg +
+ + + +
+
+ + +

25 - 50 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 49 + http://localhost:8080/js/jquery.js
+ anonymous: +20-21, 6264 call(s) (max depth 1), 41.32ms total, 0ms min, 0.45ms max, +0.01ms avg, excluding calls: 41.32ms total, 0ms min, 0.45ms max, 0.01ms +avg +
+ + + +
+ + + + 50 + http://localhost:8080/js/jquery.js
+ anonymous: +24-26, 1827 call(s), 33.86ms total, 0.01ms min, 0.69ms max, 0.02ms avg, +excluding calls: 33.86ms total, 0.01ms min, 0.69ms max, 0.02ms avg +
+ + + +
+ + + + 51 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 929 call(s), 31.34ms total, 0.03ms min, 0.12ms max, 0.03ms avg, +excluding calls: 28.97ms total, 0.03ms min, 0.09ms max, 0.03ms avg +
+ + + +
+ + + + 52 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 465 call(s), 27.76ms total, 0.02ms min, 0.47ms max, 0.06ms avg, +excluding calls: 15.35ms total, 0.01ms min, 0.25ms max, 0.03ms avg +
+ + + +
+ + + + 53 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 58 call(s), 25.35ms total, 0.41ms min, 0.92ms max, 0.44ms avg, +excluding calls: 13.07ms total, 0.21ms min, 0.26ms max, 0.23ms avg +
+ + + +
+
+ + +

10 - 25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 54 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 30 call(s), 22.61ms total, 0.04ms min, 21.5ms max, 0.75ms avg, +excluding calls: 0.53ms total, 0.01ms min, 0.2ms max, 0.02ms avg +
+ + + +
+ + + + 55 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 58 call(s), 20.61ms total, 0.33ms min, 0.7ms max, 0.36ms avg, +excluding calls: 0.9ms total, 0.01ms min, 0.35ms max, 0.02ms avg +
+ + + +
+ + + + 56 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 116 call(s), 18.55ms total, 0.13ms min, 0.22ms max, 0.16ms avg, +excluding calls: 0.87ms total, 0.01ms min, 0.04ms max, 0.01ms avg +
+ + + +
+ + + + 57 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 1044 call(s), 17.84ms total, 0.01ms min, 0.07ms max, 0.02ms avg, +excluding calls: 5.21ms total, 0ms min, 0.02ms max, 0ms avg +
+ + + +
+ + + + 58 + http://localhost:8080/js/jquery.js
+ anonymous: +20-21, 754 call(s), 17.69ms total, 0ms min, 0.34ms max, 0.02ms avg, +excluding calls: 17.69ms total, 0ms min, 0.34ms max, 0.02ms avg +
+ + + +
+ + + + 59 + http://localhost:8080/js/jquery.js
+ anonymous: +29-32, 87 call(s), 16.74ms total, 0.08ms min, 0.66ms max, 0.19ms avg, +excluding calls: 16.74ms total, 0.08ms min, 0.66ms max, 0.19ms avg +
+ + + +
+ + + + 60 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 116 call(s), 13.91ms total, 0.1ms min, 0.17ms max, 0.12ms avg, +excluding calls: 4.57ms total, 0.03ms min, 0.06ms max, 0.04ms avg +
+ + + +
+ + + + 61 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 18 call(s), 12.48ms total, 0.53ms min, 1.86ms max, 0.69ms avg, +excluding calls: 0.4ms total, 0.02ms min, 0.13ms max, 0.02ms avg +
+ + + +
+ + + + 62 + http://localhost:8080/js/jquery.js
+ anonymous: +22-23, 18 call(s), 12.08ms total, 0.52ms min, 1.84ms max, 0.67ms avg, +excluding calls: 4.65ms total, 0.18ms min, 1.5ms max, 0.26ms avg +
+ + + +
+
+ + +

7.5 - 10 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 63 + http://localhost:8080/js/jquery.js
+ anonymous: +29-30, 58 call(s), 8.11ms total, 0.08ms min, 0.27ms max, 0.14ms avg, +excluding calls: 8.11ms total, 0.08ms min, 0.27ms max, 0.14ms avg +
+ + + +
+
+ + +

5 - 7.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 64 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 203 call(s), 6.54ms total, 0.02ms min, 0.08ms max, 0.03ms avg, +excluding calls: 2.64ms total, 0.01ms min, 0.04ms max, 0.01ms avg +
+ + + +
+
+ + +

2.5 - 5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 65 + http://localhost:8080/js/jquery.js
+ anonymous: +22-23, 78 call(s), 4.57ms total, 0.05ms min, 0.08ms max, 0.06ms avg, +excluding calls: 1.19ms total, 0.01ms min, 0.03ms max, 0.02ms avg +
+ + + +
+ + + + 66 + http://localhost:8080/js/jquery.js
+ anonymous: +13-14, 58 call(s), 3.94ms total, 0.06ms min, 0.09ms max, 0.07ms avg, +excluding calls: 3.94ms total, 0.06ms min, 0.09ms max, 0.07ms avg +
+ + + +
+ + + + 67 + http://localhost:8080/js/jquery.js
+ anonymous: +22-23, 78 call(s), 3.38ms total, 0.04ms min, 0.05ms max, 0.04ms avg, +excluding calls: 2.95ms total, 0.04ms min, 0.05ms max, 0.04ms avg +
+ + + +
+ + + + 68 + http://localhost:8080/js/jquery.js
+ complete: +29-30, 58 call(s), 3.35ms total, 0.03ms min, 0.11ms max, 0.06ms avg, +excluding calls: 1.81ms total, 0.02ms min, 0.08ms max, 0.03ms avg +
+ + + +
+
+ + +

1 - 2.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 69 + http://localhost:8080/js/jquery.js
+ anonymous: +27-28, 30 call(s), 1.99ms total, 0.03ms min, 1.02ms max, 0.07ms avg, +excluding calls: 0.47ms total, 0.01ms min, 0.2ms max, 0.02ms avg +
+ + + +
+ + + + 70 + http://localhost:8080/js/jquery.js
+ anonymous: +29-30, 58 call(s), 1.97ms total, 0.02ms min, 0.07ms max, 0.03ms avg, +excluding calls: 1.97ms total, 0.02ms min, 0.07ms max, 0.03ms avg +
+ + + +
+ + + + 71 + http://localhost:8080/js/jquery.js
+ anonymous: +28-29, 60 call(s), 1.81ms total, 0.02ms min, 0.19ms max, 0.03ms avg, +excluding calls: 1.81ms total, 0.02ms min, 0.19ms max, 0.03ms avg +
+ + + +
+ + + + 72 + http://localhost:8080/js/jquery.js
+ anonymous: +22-23, 116 call(s), 1.52ms total, 0.01ms min, 0.03ms max, 0.01ms avg, +excluding calls: 1.25ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+ + + + 73 + http://localhost:8080/js/jquery.js
+ anonymous: +26-27, 87 call(s), 1.15ms total, 0.01ms min, 0.02ms max, 0.01ms avg, +excluding calls: 0.98ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+
+ + +

0.25 - 0.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 74 + http://localhost:8080/js/jquery.js
+ anonymous: +25-26, 78 call(s), 0.43ms total, 0.01ms min, 0.01ms max, 0.01ms avg, +excluding calls: 0.43ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+
+ + +

0.17 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 75 + http://localhost:8080/js/jquery.js
+ anonymous: 26-27, 87 call(s), 0.17ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0.17ms total, 0ms min, 0ms max, 0ms avg +
+ + + +
+ + + + 76 + http://localhost:8080/js/jquery.js
+ anonymous: 13-14, 58 call(s), 0.11ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0.11ms total, 0ms min, 0ms max, 0ms avg +
+ + + +
+
+
+
+
+ + +

http://localhost:8080/js/pageMinichat.js

+ + + +

5000 - 1000000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +732-764, 29 call(s), 5211.07ms total, 172.09ms min, 216.61ms max, +179.69ms avg, excluding calls: 2.63ms total, 0.08ms min, 0.1ms max, +0.09ms avg +
+ + + +
+
+ + +

2500 - 5000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 1 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +742-759, 58 call(s), 4222.75ms total, 67.28ms min, 117.13ms max, +72.81ms avg, excluding calls: 6.39ms total, 0.1ms min, 0.37ms max, +0.11ms avg +
+ + + +
+ + + + 2 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +566-570, 58 call(s), 3653.43ms total, 56.72ms min, 108.43ms max, +62.99ms avg, excluding calls: 4.99ms total, 0.07ms min, 0.17ms max, +0.09ms avg +
+ + + +
+
+ + +

1000 - 2500 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 3 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +579-612, 522 call(s), 2168.82ms total, 3.46ms min, 11.63ms max, 4.15ms +avg, excluding calls: 57.77ms total, 0.1ms min, 0.61ms max, 0.11ms avg +
+ + + +
+ + + + 4 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +684-692, 58 call(s), 1479.62ms total, 24.76ms min, 26.69ms max, 25.51ms +avg, excluding calls: 1.08ms total, 0.02ms min, 0.03ms max, 0.02ms avg +
+ + + +
+ + + + 5 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +395-437, 58 call(s), 1478.54ms total, 24.74ms min, 26.67ms max, 25.49ms +avg, excluding calls: 27.6ms total, 0.4ms min, 0.94ms max, 0.48ms avg +
+ + + +
+
+ + +

750 - 1000 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 6 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +699-704, 29 call(s), 974.37ms total, 31.17ms min, 42.63ms max, 33.6ms +avg, excluding calls: 0.48ms total, 0.01ms min, 0.08ms max, 0.02ms avg +
+ + + +
+ + + + 7 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +384-387, 58 call(s), 973.89ms total, 13.64ms min, 23.81ms max, 16.79ms +avg, excluding calls: 1.31ms total, 0.02ms min, 0.03ms max, 0.02ms avg +
+ + + +
+
+ + +

500 - 750 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 8 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +341-345, 58 call(s), 502.35ms total, 7.43ms min, 10.38ms max, 8.66ms +avg, excluding calls: 1.87ms total, 0.03ms min, 0.04ms max, 0.03ms avg +
+ + + +
+
+ + +

250 - 500 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 9 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +363-364, 15 call(s), 474.89ms total, 16.62ms min, 148.74ms max, 31.66ms +avg, excluding calls: 0.37ms total, 0.01ms min, 0.03ms max, 0.02ms avg +
+ + + +
+ + + + 10 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +632-635, 15 call(s), 474.53ms total, 16.6ms min, 148.71ms max, 31.64ms +avg, excluding calls: 1.56ms total, 0.02ms min, 0.43ms max, 0.1ms avg +
+ + + +
+ + + + 11 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +239-247, 522 call(s), 401.27ms total, 0.28ms min, 2.1ms max, 0.77ms +avg, excluding calls: 13.46ms total, 0.02ms min, 0.4ms max, 0.03ms avg +
+ + + +
+ + + + 12 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +360-361, 14 call(s), 310.5ms total, 6.95ms min, 26.81ms max, 22.18ms +avg, excluding calls: 0.64ms total, 0.01ms min, 0.32ms max, 0.05ms avg +
+ + + +
+ + + + 13 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +627-630, 14 call(s), 309.87ms total, 6.94ms min, 26.78ms max, 22.13ms +avg, excluding calls: 1.98ms total, 0.02ms min, 0.44ms max, 0.14ms avg +
+ + + +
+
+ + +

100 - 250 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 14 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +246-249, 494 call(s), 225.51ms total, 0.42ms min, 1.26ms max, 0.46ms +avg, excluding calls: 27.03ms total, 0.05ms min, 0.24ms max, 0.05ms avg +
+ + + +
+ + + + 15 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +436-465, 522 call(s), 202.38ms total, 0.36ms min, 0.58ms max, 0.39ms +avg, excluding calls: 9.84ms total, 0.02ms min, 0.03ms max, 0.02ms avg +
+ + + +
+ + + + 16 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +712-768, 58 call(s), 183.34ms total, 1.69ms min, 6.64ms max, 3.16ms +avg, excluding calls: 8.97ms total, 0.09ms min, 0.63ms max, 0.15ms avg +
+ + + +
+
+ + +

50 - 75 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 17 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +434-435, 522 call(s), 72.97ms total, 0.13ms min, 0.5ms max, 0.14ms avg, +excluding calls: 11.55ms total, 0.02ms min, 0.37ms max, 0.02ms avg +
+ + + +
+ + + + 18 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +763-764, 29 call(s), 71.63ms total, 2.01ms min, 6.21ms max, 2.47ms avg, +excluding calls: 0.51ms total, 0.01ms min, 0.04ms max, 0.02ms avg +
+ + + +
+
+ + +

25 - 50 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 19 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +535-558, 58 call(s), 45.74ms total, 0.42ms min, 1.4ms max, 0.79ms avg, +excluding calls: 18.72ms total, 0.17ms min, 0.62ms max, 0.32ms avg +
+ + + +
+
+ + +

10 - 25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 20 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +319-322, 1 call(s), 20.55ms total, 20.55ms min, 20.55ms max, 20.55ms +avg, excluding calls: 0.03ms total, 0.03ms min, 0.03ms max, 0.03ms avg +
+ + + +
+
+ + +

5 - 7.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 21 + http://localhost:8080/js/pageMinichat.js
+ Message: +220-233, 522 call(s), 5.61ms total, 0.01ms min, 0.08ms max, 0.01ms avg, +excluding calls: 5.61ms total, 0.01ms min, 0.08ms max, 0.01ms avg +
+ + + +
+
+ + +

2.5 - 5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 22 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +371-373, 464 call(s), 3.75ms total, 0.01ms min, 0.02ms max, 0.01ms avg, +excluding calls: 3.75ms total, 0.01ms min, 0.02ms max, 0.01ms avg +
+ + + +
+ + + + 23 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +376-381, 522 call(s), 3.65ms total, 0.01ms min, 0.04ms max, 0.01ms avg, +excluding calls: 3.65ms total, 0.01ms min, 0.04ms max, 0.01ms avg +
+ + + +
+ + + + 24 + http://localhost:8080/js/pageMinichat.js
+ Reponse: +198-208, 494 call(s), 2.8ms total, 0ms min, 0.2ms max, 0.01ms avg, +excluding calls: 2.8ms total, 0ms min, 0.2ms max, 0.01ms avg +
+ + + +
+
+ + +

1 - 2.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 25 + http://localhost:8080/js/pageMinichat.js
+ anonymous: +746-749, 522 call(s), 2.26ms total, 0ms min, 0.03ms max, 0ms avg, +excluding calls: 2.26ms total, 0ms min, 0.03ms max, 0ms avg +
+ + + +
+
+ + +

0 - 0.25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 26 + http://localhost:8080/js/pageMinichat.js
+ anonymous: 317-318, 1 call(s), 0ms total, 0ms min, 0ms max, 0ms avg, excluding calls: 0ms total, 0ms min, 0ms max, 0ms avg +
+ + + +
+
+
+
+
+ + +

http://localhost:8080/lightbox/js/lightbox.js

+ + + +

10 - 25 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + http://localhost:8080/lightbox/js/lightbox.js
+ anonymous: +337-365, 58 call(s), 15.6ms total, 0.24ms min, 0.65ms max, 0.27ms avg, +excluding calls: 15.6ms total, 0.24ms min, 0.65ms max, 0.27ms avg +
+ + + +
+
+
+
+
+ + +

http://localhost:8080/lightbox/js/prototype.js

+ + + +

0.25 - 0.5 ms

+ [ Previous File | + Next File | + Previous Range | + Next Range ] + + + + 0 + http://localhost:8080/lightbox/js/prototype.js
+ anonymous: +456-458, 58 call(s), 0.31ms total, 0.01ms min, 0.01ms max, 0.01ms avg, +excluding calls: 0.31ms total, 0.01ms min, 0.01ms max, 0.01ms avg +
+ + + +
+
+
+
+
+ No job is too big, no fee is too big. + + \ No newline at end of file diff --git a/doc/profiling/JavaScript Profile Data 2008-04-15_files/a b/doc/profiling/JavaScript Profile Data 2008-04-15_files/a new file mode 100644 index 0000000..43f0e66 Binary files /dev/null and b/doc/profiling/JavaScript Profile Data 2008-04-15_files/a differ diff --git a/doc/profiling/profiling.txt b/doc/profiling/profiling.txt new file mode 100644 index 0000000..02a18a8 --- /dev/null +++ b/doc/profiling/profiling.txt @@ -0,0 +1,5 @@ +== Profiling Euphorik == +Ce fichier décrit les différents profiling réalisés. + +== 2008-04-15 == +Changement de page. \ No newline at end of file diff --git a/doc/protocole3.txt b/doc/protocole3.txt new file mode 100644 index 0000000..66f688d --- /dev/null +++ b/doc/protocole3.txt @@ -0,0 +1,397 @@ +Euphorik - Protocole v3 +----------------------- + +== Introduction == +Ce document a pour but de décrire la communication client-serveur du site euphorik. +Les messages échangés sont basés sur le format JSON. +Ce document remplace 'protocole2.txt'. + + +== Principes == +Enregistrement: + * Permet de créer un compte, un cookie est donné en retour. Ce cookie doit être stocké par le client pour pouvoir s'authentifier par la suite. + +Authentification: + * L'authentification (login) se fait soit par un couple soit à l'aide d'un cookie. + * Permet de récupérer les données d'un profile + +Rafraichissement: + * Le client envoie une demande au serveur avec l'id du dernier message (via XMLHttpRequest ou un function de JQuery) + * Le serveur maintient la connexion bloquée si le client est à jour. + * Dès qu'un nouveau message arrive, le serveur débloque la connexion et envoie le ou les messages manquants. + + +== Protocole == +c : client +s : server +Les messages client vers serveur sont envoyés par HTTP-POST. + +A toutes les requêtes le serveur peut répondre une erreur : + + { + "reply" : "error", + "error_message" : "blabla" + } + +Message ok générique : + + { + "reply" : "ok" + } + + +=== Enregistrement et authentification === +Permet de créer un nouvel utilisateur. +"login" et "password" peuvent ne pas être fournis avec un message de type "register", dans ce cas l'utilisateur ne pourra s'authentifier qu'a l'aide de son cookie. +Le mot de passe est hashé en md5. + +c -> s + { + "action" : "authentification", + "login" : "paul", + "password" : "IJKJDHHSAD9081238" + } +ou + { + "action" : "authentification", + "cookie" : "LKJDLAKSJBFLKASN" + } +ou + { + "action" : "register", + "login" : "paul", + "password" : "IJKJDHHSAD9081238" + } + +s -> c + { + "reply" : "register" | "authentification", + "status" : "auth_not_registered", + "cookie" : "LKJDLAKSJBFLKASN", + "id" : 193, + "css" : "css/1/euphorik.css", + "main_page" : 1 + } +ou + { + "reply" : "register" | "authentification", + "status" : "auth_registered", + "cookie" : "LKJDLAKSJBFLKASN", + "id" : 193, + "nick" : "Paul", + "login" : "paul49", + "email" : "paul@pierre.com", + "css" : "css/3/euphorik.css", + "nick_format" : "nick" | "login" | "nick_login", + "view_times" : true | false, + "view_tooltips" : true | false, + "main_page" : 1, + "conversations" : [ + { + "racine" : 123, + "page" : 1 + } + ], + "ek_master" : true | false + } + + +=== Logout === +c -> s + { + "action" : "logout", + "cookie" : "LKJDLAKSJBFLKASN" + } + + +=== Profile === +c -> s + { + "action" : "set_profile", + "cookie" : "LKJDLAKSJBFLKASN", + "login" : "paul49", + "password" : "IJKJDHHSAD9081238", + "nick" : "Paul", + "email" : "paul@pierre.com", + "css" : "css/3/euphorik.css", + "nick_format" : "nick" | "login" | "nick_login", + "view_times" : true | false, + "view_tooltips" : true | false, + "main_page" : 1, + "conversations" : [ + { + "root" : 123, + "page" : 1 + } + ] + } + +s -> c + +ou + + + +=== Wait event (page = chat) === +Si "last_message_id" est absent alors le client ne possède pas de message. +Si "main_page" est absent alors est vaut 1. +"cookie" n'est pas obligatoire. + +c -> s + { + "action" : "wait_event", + "page" : "chat" + "cookie" : "LKJDLAKSJBFLKASN", + "message_count" : 10, + "last_message_id" : 163, + "main_page" : 1, + "troll_id" : 45, + "conversations" : [ + { + "racine" : 123, + "page" : 1, + "last_message_id" : 4 (pas obligatoire) + } + ] + } + +s -> c +La première conversation est la principale (main). +L'ordre des conversation est le même que celui des données de l'utilisateur. +Le format de la date n'est pas formel. + { + "reply" : "new_message", + "conversations" : [ + { + "last_page" : true | false, + "messages" : [ + { + "id" : 54, + "user_id" : 344, + "date" : "Hier 17:26:54", + "system" : true | false, + "owner" : true | false, + "answered" : true | false, + "is_a_reply" : true | false, + "nick" : "Paul", + "login" : "paul_22", + "content" : "Salut", + "answer_to" : [ + { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" } + ] + "ek_master" : true | false + } + ] + } + ... + ] + } +ou + { + "reply" : "message_updated", + "message_id" : 123, + "content" : "Salut +++ poulpe" + } +ou + { + "reply" : "new_troll", + "troll_id" : 123, + "message_id" : 12, + "content" : "Linux sera desktop ready en 2008 ?" + } +ou + + + +=== Wait event (page = admin) === +c -> s + { + "action" : "wait_event", + "page" : "admin", + "last_troll" : 5 + } + +s -> c + { + "reply" : "troll_modified", + "troll_id" : 3, + "content" : "plop" + } +ou +s -> c + { + "reply" : "troll_added", + "trolls" : + [ + { + "troll_id" : 5, + "content" : "plop", + "author" : "" + "author_id" : 2 + } + ] + } +ou +s -> c + { + "reply" : "troll_deleted", + "troll_id" : 2 + } +ou +indique de mettre à jour la liste d'ips +s -> c + { + "reply" : "banned_ips_refresh" + } + + +=== Envoie d'un troll === +c -> s + { + "action" : "put_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "content" : "Un bon troll velu !" + } + +s -> c + +ou + + + +=== Modification d'un troll === +c -> s + { + "action" : "mod_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "troll_id" : 3, + "content" : "Un bon troll velu 2 !" + } + +s -> c + +ou + + + +=== Suppression d'un troll === +c -> s + { + "action" : "del_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "troll_id" : 3 + } + +s -> c + +ou + + + +=== Envoie message === +Le client envoie un message, le message peut répondre à un certain nombre d'autres messages. +"answer_to" n'est pas obligatoire. + +c -> s + { + "action" : "put_message", + "cookie" : "LKJDLAKSJBFLKASN", + "nick" : "Paul", + "content" : "Bonjour", + "answer_to" : [ 345, 532, ... ] + } + +s -> c + +ou + + + +=== Slapage === +c -> s + { + "action" : "slap", + "cookie" : "LKJDLAKSJBFLKASN", + "user_id" : 67, + "reason" : "blablabla" + } + +s -> c + +ou + + + +=== Bannissement === +c -> s + { + "action" : "ban", + "cookie" : "LKJDLAKSJBFLKASN", + "duration" : 15, // en minute + "user_id" : 67, + "reason" : "blablabla" + } + +s -> c + +ou + + + +=== Liste des ip bannis === +c -> s + { + "action" : "list_banned_ips", + "cookie" : "LKJDLAKSJBFLKASN" + } + +s -> c + { + "reply" : "list_banned_ips", + "list" : [ + { + ip : "192.168.1.2", + remaining_time : "1h23" + users : [ + { + nick : "Pierre" , + login : "pierre" + } + ] + } + ] + } + + +=== Débannissement === +c -> s + { + "action" : "unban", + "cookie" : "LKJDLAKSJBFLKASN" + "ip" : "192.168.1.2" + } + +s -> c + +ou + + + +=== Ajout d'une correction d'un messages === +Le client envoie un correctif sous la forme de texte supplémentaire à appondre au dernier messages. +Le message est appondu avec un " +++ " devant, par exemple : +> Gnome c'est mieux que KDE +++ Euh non ok, c'est faux + +c -> s + { + "action" : "correction", + "cookie" : "LKJDLAKSJBFLKASN", + "content" : "Euh non ok, c'est faux" + } + +s -> c + { + "reply" : "correction", + "status" : "ok" | "error", + "message_error" : "blabla" + } diff --git a/doc/technique.txt b/doc/technique.txt new file mode 100644 index 0000000..1d45db1 --- /dev/null +++ b/doc/technique.txt @@ -0,0 +1,49 @@ +Euphorik - doc technique + + +== euphorik.js == +Sequences : + * Chargement d'une page + +=== Client === +== pageMinichat.js == +=== Classes === + * Messages + * Conversation + * Message + + +=== Séquences === + * Attente de nouveaux messages + a) Messages.rafraichirMessages + b) pour chaque conversation + i) Messages.ajouterMessages(lesMessages, numConv) + ii) Conversation.flush + + * Ajout d'un message + PageMinichat.envoyerMessage(pseudo, message) : requête AJAX + + * Extraction d'une conversation + a) Conversation.click + b) Client.ajouterConversation(idMess) + c) Client.flush(false) // mise à jour du profile de manière synchrone + d) Messages.rafraichirMessages(true) + + * Suppression d'une conversation + +=== Exemple de conversation === +Utilisé lors des tests + +m1 +m2 -> m1 +m3 -> m1 +m4 -> m2 +m5 -> m3 +m6 -> m3 +m7 +m8 -> m7 +m9 -> m7 + + + + diff --git a/doc/uml.zargo b/doc/uml.zargo new file mode 100644 index 0000000..14e23be Binary files /dev/null and b/doc/uml.zargo differ diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..f1ea6b1 Binary files /dev/null and b/favicon.ico differ diff --git a/img/ban.gif b/img/ban.gif new file mode 100644 index 0000000..9a7d412 Binary files /dev/null and b/img/ban.gif differ diff --git a/img/css1/copier_conv.png b/img/css1/copier_conv.png new file mode 100644 index 0000000..be21326 Binary files /dev/null and b/img/css1/copier_conv.png differ diff --git a/img/css1/copier_conv_hover.png b/img/css1/copier_conv_hover.png new file mode 100644 index 0000000..344483e Binary files /dev/null and b/img/css1/copier_conv_hover.png differ diff --git a/img/css1/extraction.png b/img/css1/extraction.png new file mode 100644 index 0000000..6140ab5 Binary files /dev/null and b/img/css1/extraction.png differ diff --git a/img/css1/extraction_hover.png b/img/css1/extraction_hover.png new file mode 100644 index 0000000..1a33ea3 Binary files /dev/null and b/img/css1/extraction_hover.png differ diff --git a/img/css1/fermer_conv.png b/img/css1/fermer_conv.png new file mode 100644 index 0000000..364bf50 Binary files /dev/null and b/img/css1/fermer_conv.png differ diff --git a/img/css1/fermer_conv_hover.png b/img/css1/fermer_conv_hover.png new file mode 100644 index 0000000..f527f3e Binary files /dev/null and b/img/css1/fermer_conv_hover.png differ diff --git a/img/css1/fleche.png b/img/css1/fleche.png new file mode 100644 index 0000000..97aab99 Binary files /dev/null and b/img/css1/fleche.png differ diff --git a/img/css1/fleche_bulle.png b/img/css1/fleche_bulle.png new file mode 100644 index 0000000..0676a33 Binary files /dev/null and b/img/css1/fleche_bulle.png differ diff --git a/img/css1/fleche_reponda.png b/img/css1/fleche_reponda.png new file mode 100644 index 0000000..6f2e387 Binary files /dev/null and b/img/css1/fleche_reponda.png differ diff --git a/img/css1/fond.png b/img/css1/fond.png new file mode 100644 index 0000000..973b83b Binary files /dev/null and b/img/css1/fond.png differ diff --git a/img/css1/logo.png b/img/css1/logo.png new file mode 100644 index 0000000..546676d Binary files /dev/null and b/img/css1/logo.png differ diff --git a/img/css1/logo_fond.png b/img/css1/logo_fond.png new file mode 100644 index 0000000..3b9d33e Binary files /dev/null and b/img/css1/logo_fond.png differ diff --git a/img/css1/return.png b/img/css1/return.png new file mode 100755 index 0000000..51f1983 Binary files /dev/null and b/img/css1/return.png differ diff --git a/img/css1/triangle.png b/img/css1/triangle.png new file mode 100644 index 0000000..2fd067b Binary files /dev/null and b/img/css1/triangle.png differ diff --git a/img/css2/bouton_smiles.png b/img/css2/bouton_smiles.png new file mode 100644 index 0000000..40a681d Binary files /dev/null and b/img/css2/bouton_smiles.png differ diff --git a/img/css2/fleche_bulle.png b/img/css2/fleche_bulle.png new file mode 100644 index 0000000..627fed0 Binary files /dev/null and b/img/css2/fleche_bulle.png differ diff --git a/img/css2/fond.png b/img/css2/fond.png new file mode 100755 index 0000000..2a46fbc Binary files /dev/null and b/img/css2/fond.png differ diff --git a/img/css2/logo_1.png b/img/css2/logo_1.png new file mode 100755 index 0000000..06318b0 Binary files /dev/null and b/img/css2/logo_1.png differ diff --git a/img/css2/logo_2.png b/img/css2/logo_2.png new file mode 100755 index 0000000..0a7da96 Binary files /dev/null and b/img/css2/logo_2.png differ diff --git a/img/css2/return.png b/img/css2/return.png new file mode 100755 index 0000000..b9d146b Binary files /dev/null and b/img/css2/return.png differ diff --git a/img/css3/logo.gif b/img/css3/logo.gif new file mode 100755 index 0000000..92f49bd Binary files /dev/null and b/img/css3/logo.gif differ diff --git a/img/css3/logo.png b/img/css3/logo.png new file mode 100755 index 0000000..dc6bd85 Binary files /dev/null and b/img/css3/logo.png differ diff --git a/img/css3/piedpage.png b/img/css3/piedpage.png new file mode 100755 index 0000000..095fdb7 Binary files /dev/null and b/img/css3/piedpage.png differ diff --git a/img/exclamation.gif b/img/exclamation.gif new file mode 100755 index 0000000..46bb733 Binary files /dev/null and b/img/exclamation.gif differ diff --git a/img/fermer.gif b/img/fermer.gif new file mode 100755 index 0000000..3d78493 Binary files /dev/null and b/img/fermer.gif differ diff --git a/img/information.gif b/img/information.gif new file mode 100755 index 0000000..c75a5d6 Binary files /dev/null and b/img/information.gif differ diff --git a/img/interrogation.gif b/img/interrogation.gif new file mode 100755 index 0000000..47fd4b0 Binary files /dev/null and b/img/interrogation.gif differ diff --git a/img/kick.gif b/img/kick.gif new file mode 100644 index 0000000..ce127dd Binary files /dev/null and b/img/kick.gif differ diff --git a/img/lightbox-blank.gif b/img/lightbox-blank.gif new file mode 100644 index 0000000..1d11fa9 Binary files /dev/null and b/img/lightbox-blank.gif differ diff --git a/img/lightbox-btn-close.gif b/img/lightbox-btn-close.gif new file mode 100644 index 0000000..33bcf51 Binary files /dev/null and b/img/lightbox-btn-close.gif differ diff --git a/img/lightbox-btn-next.gif b/img/lightbox-btn-next.gif new file mode 100644 index 0000000..a0d4fcf Binary files /dev/null and b/img/lightbox-btn-next.gif differ diff --git a/img/lightbox-btn-prev.gif b/img/lightbox-btn-prev.gif new file mode 100644 index 0000000..040ee59 Binary files /dev/null and b/img/lightbox-btn-prev.gif differ diff --git a/img/lightbox-ico-loading.gif b/img/lightbox-ico-loading.gif new file mode 100644 index 0000000..4f1429c Binary files /dev/null and b/img/lightbox-ico-loading.gif differ diff --git a/img/loading.gif b/img/loading.gif new file mode 100644 index 0000000..166fe85 Binary files /dev/null and b/img/loading.gif differ diff --git a/img/powered-by-yaws.gif b/img/powered-by-yaws.gif new file mode 100755 index 0000000..8c874d8 Binary files /dev/null and b/img/powered-by-yaws.gif differ diff --git a/img/slap.gif b/img/slap.gif new file mode 100644 index 0000000..2265fda Binary files /dev/null and b/img/slap.gif differ diff --git a/img/smileys/agreed.gif b/img/smileys/agreed.gif new file mode 100644 index 0000000..b7a08e1 Binary files /dev/null and b/img/smileys/agreed.gif differ diff --git a/img/smileys/alien.gif b/img/smileys/alien.gif new file mode 100755 index 0000000..b75a32b Binary files /dev/null and b/img/smileys/alien.gif differ diff --git a/img/smileys/argn.gif b/img/smileys/argn.gif new file mode 100755 index 0000000..63d39a8 Binary files /dev/null and b/img/smileys/argn.gif differ diff --git a/img/smileys/autres/icon_angry.gif b/img/smileys/autres/icon_angry.gif new file mode 100755 index 0000000..15f9ccb Binary files /dev/null and b/img/smileys/autres/icon_angry.gif differ diff --git a/img/smileys/autres/icon_chinese.gif b/img/smileys/autres/icon_chinese.gif new file mode 100755 index 0000000..b162cfb Binary files /dev/null and b/img/smileys/autres/icon_chinese.gif differ diff --git a/img/smileys/autres/icon_confused.gif b/img/smileys/autres/icon_confused.gif new file mode 100755 index 0000000..b20fcb3 Binary files /dev/null and b/img/smileys/autres/icon_confused.gif differ diff --git a/img/smileys/autres/icon_cool.gif b/img/smileys/autres/icon_cool.gif new file mode 100755 index 0000000..bf0fd09 Binary files /dev/null and b/img/smileys/autres/icon_cool.gif differ diff --git a/img/smileys/autres/icon_largesmile.gif b/img/smileys/autres/icon_largesmile.gif new file mode 100755 index 0000000..19c523f Binary files /dev/null and b/img/smileys/autres/icon_largesmile.gif differ diff --git a/img/smileys/autres/icon_lol.gif b/img/smileys/autres/icon_lol.gif new file mode 100755 index 0000000..ebbec8b Binary files /dev/null and b/img/smileys/autres/icon_lol.gif differ diff --git a/img/smileys/autres/icon_mrgreen.gif b/img/smileys/autres/icon_mrgreen.gif new file mode 100755 index 0000000..29280bb Binary files /dev/null and b/img/smileys/autres/icon_mrgreen.gif differ diff --git a/img/smileys/autres/icon_neutral.gif b/img/smileys/autres/icon_neutral.gif new file mode 100755 index 0000000..6341536 Binary files /dev/null and b/img/smileys/autres/icon_neutral.gif differ diff --git a/img/smileys/autres/icon_redface.gif b/img/smileys/autres/icon_redface.gif new file mode 100755 index 0000000..6670542 Binary files /dev/null and b/img/smileys/autres/icon_redface.gif differ diff --git a/img/smileys/autres/icon_rolleyes.gif b/img/smileys/autres/icon_rolleyes.gif new file mode 100755 index 0000000..b2aab79 Binary files /dev/null and b/img/smileys/autres/icon_rolleyes.gif differ diff --git a/img/smileys/autres/icon_sad.gif b/img/smileys/autres/icon_sad.gif new file mode 100755 index 0000000..31cdd5f Binary files /dev/null and b/img/smileys/autres/icon_sad.gif differ diff --git a/img/smileys/autres/icon_smile.gif b/img/smileys/autres/icon_smile.gif new file mode 100755 index 0000000..71cd97a Binary files /dev/null and b/img/smileys/autres/icon_smile.gif differ diff --git a/img/smileys/autres/icon_surprised.gif b/img/smileys/autres/icon_surprised.gif new file mode 100755 index 0000000..3fdfc9d Binary files /dev/null and b/img/smileys/autres/icon_surprised.gif differ diff --git a/img/smileys/autres/icon_tongue.gif b/img/smileys/autres/icon_tongue.gif new file mode 100755 index 0000000..5e25f32 Binary files /dev/null and b/img/smileys/autres/icon_tongue.gif differ diff --git a/img/smileys/autres/icon_whistle.gif b/img/smileys/autres/icon_whistle.gif new file mode 100755 index 0000000..9c20056 Binary files /dev/null and b/img/smileys/autres/icon_whistle.gif differ diff --git a/img/smileys/autres/icon_wink.gif b/img/smileys/autres/icon_wink.gif new file mode 100755 index 0000000..c9e1a66 Binary files /dev/null and b/img/smileys/autres/icon_wink.gif differ diff --git a/img/smileys/bigsmile.gif b/img/smileys/bigsmile.gif new file mode 100755 index 0000000..b54cd0f Binary files /dev/null and b/img/smileys/bigsmile.gif differ diff --git a/img/smileys/bn.gif b/img/smileys/bn.gif new file mode 100644 index 0000000..dba4463 Binary files /dev/null and b/img/smileys/bn.gif differ diff --git a/img/smileys/boh.gif b/img/smileys/boh.gif new file mode 100644 index 0000000..467b7fe Binary files /dev/null and b/img/smileys/boh.gif differ diff --git a/img/smileys/bunny.gif b/img/smileys/bunny.gif new file mode 100755 index 0000000..5faa5d5 Binary files /dev/null and b/img/smileys/bunny.gif differ diff --git a/img/smileys/chat.gif b/img/smileys/chat.gif new file mode 100755 index 0000000..33cb58f Binary files /dev/null and b/img/smileys/chat.gif differ diff --git a/img/smileys/clin.gif b/img/smileys/clin.gif new file mode 100755 index 0000000..13d446d Binary files /dev/null and b/img/smileys/clin.gif differ diff --git a/img/smileys/cool.gif b/img/smileys/cool.gif new file mode 100755 index 0000000..c3aff9d Binary files /dev/null and b/img/smileys/cool.gif differ diff --git a/img/smileys/dodo.gif b/img/smileys/dodo.gif new file mode 100644 index 0000000..7a32d09 Binary files /dev/null and b/img/smileys/dodo.gif differ diff --git a/img/smileys/eheheh.gif b/img/smileys/eheheh.gif new file mode 100755 index 0000000..4fc3e19 Binary files /dev/null and b/img/smileys/eheheh.gif differ diff --git a/img/smileys/heink.gif b/img/smileys/heink.gif new file mode 100644 index 0000000..1bf9963 Binary files /dev/null and b/img/smileys/heink.gif differ diff --git a/img/smileys/hum.gif b/img/smileys/hum.gif new file mode 100644 index 0000000..db24401 Binary files /dev/null and b/img/smileys/hum.gif differ diff --git a/img/smileys/kirby.gif b/img/smileys/kirby.gif new file mode 100755 index 0000000..19784c5 Binary files /dev/null and b/img/smileys/kirby.gif differ diff --git a/img/smileys/lol.gif b/img/smileys/lol.gif new file mode 100755 index 0000000..b5e7153 Binary files /dev/null and b/img/smileys/lol.gif differ diff --git a/img/smileys/oh.gif b/img/smileys/oh.gif new file mode 100755 index 0000000..18d3abb Binary files /dev/null and b/img/smileys/oh.gif differ diff --git a/img/smileys/pascontent.gif b/img/smileys/pascontent.gif new file mode 100755 index 0000000..7297a64 Binary files /dev/null and b/img/smileys/pascontent.gif differ diff --git a/img/smileys/redface.gif b/img/smileys/redface.gif new file mode 100644 index 0000000..6e08e7b Binary files /dev/null and b/img/smileys/redface.gif differ diff --git a/img/smileys/renne.gif b/img/smileys/renne.gif new file mode 100755 index 0000000..71c6316 Binary files /dev/null and b/img/smileys/renne.gif differ diff --git a/img/smileys/slurp.gif b/img/smileys/slurp.gif new file mode 100755 index 0000000..ab3ca57 Binary files /dev/null and b/img/smileys/slurp.gif differ diff --git a/img/smileys/smile.gif b/img/smileys/smile.gif new file mode 100755 index 0000000..3fb63ae Binary files /dev/null and b/img/smileys/smile.gif differ diff --git a/img/smileys/sniff.gif b/img/smileys/sniff.gif new file mode 100755 index 0000000..da1895d Binary files /dev/null and b/img/smileys/sniff.gif differ diff --git a/img/smileys/spliff.gif b/img/smileys/spliff.gif new file mode 100755 index 0000000..a7338cb Binary files /dev/null and b/img/smileys/spliff.gif differ diff --git a/img/smileys/star.gif b/img/smileys/star.gif new file mode 100755 index 0000000..5259b73 Binary files /dev/null and b/img/smileys/star.gif differ diff --git a/img/smileys/triste.gif b/img/smileys/triste.gif new file mode 100755 index 0000000..0d8abc8 Binary files /dev/null and b/img/smileys/triste.gif differ diff --git a/index.yaws b/index.yaws new file mode 100755 index 0000000..f345df0 --- /dev/null +++ b/index.yaws @@ -0,0 +1,55 @@ + + + + + + euphorik.ch + + out(A) -> + CSS = case euphorik_bd:css_from_user_cookie(yaws_api:find_cookie_val("cookie", A)) of + undefined -> "css/1/euphorik.css"; + C -> C + end, + {ehtml, {link , + [ + {id, "cssPrincipale" }, + {rel, "stylesheet"}, + {href, CSS}, + {type, "text/css"}, + {media, "screen"} + ], []} + }. + + + + + + + + + + + + + + +
+ + + +
+

+ +

+
+
+ +
+ + \ No newline at end of file diff --git a/js/debug.js b/js/debug.js new file mode 100644 index 0000000..c598eed --- /dev/null +++ b/js/debug.js @@ -0,0 +1,90 @@ +// coding: utf-8 +// Copyright 2008 Grégory Burri +// +// This file is part of Euphorik. +// +// Euphorik 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. +// +// Euphorik 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 Euphorik. If not, see . + +/** + * Affiche un objet quelconque sur la sortie du navigateur. + */ +var dumpObj = function(obj, name) +{ + if (typeof(dump) == "undefined") + return + + dump("---" + (name == undefined ? "" : " : " + name) + "\n") + dump(obj2text(obj)) + dump("\n---\n") +} + +var obj2text = function(obj, curDepth) +{ + if (curDepth == undefined) + curDepth = 0; + + var acc = "" + + if (obj == undefined) + { + acc += "" + } + else if (typeof(obj) == "string") + { + acc += "\"" + obj + "\"" + } + else if (obj.length != undefined) // array + { + acc += "[" + + var i = 0 + for (; i < obj.length; i++) + { + if (i != 0) acc += "," + acc += "\n" + indent(curDepth + 1, obj2text(obj[i], curDepth + 1)) + } + + acc += (i == 0 ? "]" : "\n" + indent(curDepth, "]")) + } + else if (typeof(obj) == "object") + { + acc += "{" + var i = 0 + for (prop in obj) + { + if (i != 0) acc += "," + acc += "\n" + indent(curDepth + 1, prop + " : " + obj2text(obj[prop], curDepth + 1)) + i += 1 + } + acc += "\n" + indent(curDepth, "}") + } + else if (typeof(obj) == "function") + { + acc += "" + } + else // value + { + acc += obj + } + + return acc +} + +var indent = function(depth, text) +{ + var indentText = "" + for (var i = 0; i < depth * 3; i++) + indentText += " " + return indentText + text +} diff --git a/js/euphorik.js b/js/euphorik.js new file mode 100755 index 0000000..8c0c8a2 --- /dev/null +++ b/js/euphorik.js @@ -0,0 +1,1145 @@ +// coding: utf-8 +// Copyright 2008 Grégory Burri +// +// This file is part of Euphorik. +// +// Euphorik 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. +// +// Euphorik 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 Euphorik. If not, see . + +/** + * Contient la base javascript pour le site euphorik.ch. + * Chaque page possède son propre fichier js nommé "page.js". + * Auteur : GBurri + * Date : 6.11.2007 + */ + + +/** + * La configuration. + * Normalement 'const' à la place de 'var' mais non supporté par IE7. + */ +var conf = { + nbMessageAffiche : 40, // (par page) + pseudoDefaut : "", + tempsAffichageMessageDialogue : 4000, // en ms + tempsKick : 15, // en minute + tempsBan : 60 * 24 * 3, // en minutes (3jours) + smiles : { + "smile" : [/:\)/g, /:-\)/g], + "bigsmile" : [/:D/g, /:-D/g], + "clin" : [/;\)/g, /;-\)/g], + "cool" : [/8\)/g, /8-\)/g], + "eheheh" : [/:P/g, /:-P/g], + "lol" : [/\[-lol\]/g], + "spliff" : [/\[-spliff\]/g], + "oh" : [/:o/g, /:O/g], + "heink" : [/\[-heink\]/g], + "hum" : [/\[-hum\]/g], + "boh" : [/\[-boh\]/g], + "sniff" : [/:\(/g, /:-\(/g], + "triste" : [/\[-triste\]/g], + "pascontent" : [/>\(/g, />\(/g], + "argn" : [/\[-argn\]/g], + "redface" : [/\[-redface\]/g], + "bunny" : [/\[-lapin\]/g], + "chat" : [/\[-chat\]/g], + "renne" : [/\[-renne\]/g], + "star" : [/\[-star\]/g], + "kirby" : [/\[-kirby\]/g], + "slurp" : [/\[-slurp\]/g], + "agreed" : [/\[-agreed\]/g], + "dodo" : [/\[-dodo\]/g], + "bn" : [/\[-bn\]/g] + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +String.prototype.trim = function() +{ + return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, ""); +} + +String.prototype.ltrim = function() +{ + return this.replace(/^\s+/, ""); +} + +String.prototype.rtrim = function() +{ + return this.replace(/\s+$/, ""); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Cette classe regroupe des fonctions utilitaires (helpers). + * @formateur est permet de formater les messages affichés à l'aide de messageDialogue (facultatif) + */ +function Util(formateur) +{ + $("#info .fermer").click(function(){ + $("#info").slideUp(50) + }) + + $("body").append('
').append('

') + + this.formateur = formateur + this.bulleActive = true +} + +var messageType = {informatif: 0, question: 1, erreur: 2} + +/** + * Affiche une boite de dialogue avec un message à l'intérieur. + * @param message le message (string) + * @param type voir 'messageType'. par défaut messageType.informatif + * @param les boutons sous la forme d'un objet ou les clefs sont les labels des boutons + * et les valeurs les fonctions executées lorsqu'un bouton est activé. + * @param formate faut-il formaté le message ? true par défaut + */ +Util.prototype.messageDialogue = function(message, type, boutons, formate) +{ + var thisUtil = this + + if (type == undefined) + type = messageType.informatif + + if (formate == undefined) + formate = true + + if (this.timeoutMessageDialogue != undefined) + clearTimeout(this.timeoutMessageDialogue) + + var fermer = function(){$("#info").slideUp(100)} + fermer() + + $("#info .message").html(thisUtil.formateur == undefined || !formate ? message : thisUtil.formateur.traitementComplet(message)) + switch(type) + { + case messageType.informatif : $("#info #icone").attr("class", "information"); break + case messageType.question : $("#info #icone").attr("class", "interrogation"); break + case messageType.erreur : $("#info #icone").attr("class", "exclamation"); break + } + $("#info .boutons").html("") + for (var b in boutons) + $("#info .boutons").append("
" + b + "
").find("div:last").click(boutons[b]).click(fermer) + + $("#info").slideDown(200) + this.timeoutMessageDialogue = setTimeout(fermer, conf.tempsAffichageMessageDialogue) +} + +/** + * Affiche un info bulle lorsque le curseur survole l'élément donné. + * FIXME : le width de element ne tient pas compte du padding !? + */ +Util.prototype.infoBulle = function(message, element) +{ + var thisUtil = this + + var cacherBulle = function() + { + $("#flecheBulle").hide() + $("#messageBulle").hide() + } + + element.hover( + function(e) + { + if (!thisUtil.bulleActive) + return + + var m = $("#messageBulle") + var f = $("#flecheBulle") + + $("p", m).html(message) + + var positionFleche = { + left : element.offset().left + element.width() / 2 - f.width() / 2, + top : element.offset().top - f.height() + } + var positionMessage = { + left : element.offset().left + element.width() / 2 - m.width() / 2, + top : element.offset().top - f.height() - m.height() + } + var depassementDroit = (positionMessage.left + m.width()) - $("body").width() + if (depassementDroit > 0) + positionMessage.left -= depassementDroit + else + { + if (positionMessage.left < 0) + positionMessage.left = 0 + } + + m.css("top", positionMessage.top).css("left", positionMessage.left).show() + f.css("top", positionFleche.top).css("left", positionFleche.left).show() + }, + cacherBulle + ).click(cacherBulle) +} + +/** + * Utilisé pour l'envoie de donnée avec la méthode ajax de jQuery. + */ +Util.prototype.jsonVersAction = function(json) +{ + return {action : JSON.stringify(json) } +} + +Util.prototype.md5 = function(chaine) +{ + return hex_md5(chaine) +} + +// pompé de http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130 +Util.prototype.setSelectionRange = function(input, selectionStart, selectionEnd) +{ + if (input.setSelectionRange) + { + input.focus() + input.setSelectionRange(selectionStart, selectionEnd) + } + else if (input.createTextRange) + { + var range = input.createTextRange() + range.collapse(true) + range.moveEnd('character', selectionEnd) + range.moveStart('character', selectionStart) + range.select() + } +} + +Util.prototype.setCaretToEnd = function(input) +{ + this.setSelectionRange(input, input.value.length, input.value.length) +} +Util.prototype.setCaretToBegin = function(input) +{ + this.setSelectionRange(input, 0, 0) +} +Util.prototype.setCaretToPos = function(input, pos) +{ + this.setSelectionRange(input, pos, pos) +} +Util.prototype.selectString = function(input, string) +{ + var match = new RegExp(string, "i").exec(input.value) + if (match) + { + this.setSelectionRange (input, match.index, match.index + match[0].length) + } +} +Util.prototype.replaceSelection = function(input, replaceString) { + if (input.setSelectionRange) + { + var selectionStart = input.selectionStart + var selectionEnd = input.selectionEnd + input.value = input.value.substring(0, selectionStart) + replaceString + input.value.substring(selectionEnd) + + if (selectionStart != selectionEnd) // has there been a selection + this.setSelectionRange(input, selectionStart, selectionStart + replaceString.length) + else // set caret + this.setCaretToPos(input, selectionStart + replaceString.length) + } + else if (document.selection) + { + input.focus() + var range = document.selection.createRange() + if (range.parentElement() == input) + { + var isCollapsed = range.text == '' + range.text = replaceString + if (!isCollapsed) + { + range.moveStart('character', -replaceString.length); + } + } + } +} + +Util.prototype.rot13 = function(chaine) +{ + var ACode = 'A'.charCodeAt(0) + var aCode = 'a'.charCodeAt(0) + var MCode = 'M'.charCodeAt(0) + var mCode = 'm'.charCodeAt(0) + var ZCode = 'Z'.charCodeAt(0) + var zCode = 'z'.charCodeAt(0) + + var f = function(ch, pos) { + if (pos == ch.length) + return "" + + var c = ch.charCodeAt(pos); + return String.fromCharCode( + c + + (c >= ACode && c <= MCode || c >= aCode && c <= mCode ? 13 : + (c > MCode && c <= ZCode || c > mCode && c <= zCode ? -13 : 0)) + ) + f(ch, pos + 1) + } + return f(chaine, 0) +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +function Pages() +{ + this.pageCourante = null + this.pages = {} +} + +/** + * Accepte soit un objet soit un string. + * un string correspond au nom de la page, par exemple : "page" -> "page.html" + */ +Pages.prototype.ajouterPage = function(page) +{ + if (typeof page == "string") + { + this.pages[page] = page + } + else + { + page.pages = this // la magie des langages dynamiques : le foutoire + this.pages[page.nom] = page + } +} + +Pages.prototype.afficherPage = function(nomPage, forcerChargement) +{ + if (forcerChargement == undefined) forcerChargement = false + + var page = this.pages[nomPage] + if (page == undefined || (!forcerChargement && page == this.pageCourante)) return + + if (this.pageCourante != null && this.pageCourante.decharger) + this.pageCourante.decharger() + + $("#menu li").removeClass("courante") + $("#menu li." + nomPage).addClass("courante") + + this.pageCourante = page + var contenu = "" + if (typeof page == "string") + $.ajax({async: false, url: "pages/" + page + ".html", success : function(page) { contenu += page }}) + else + contenu += this.pageCourante.contenu() + $("#page").html(contenu).removeClass().addClass(this.pageCourante.nom) + + if (this.pageCourante.charger) + this.pageCourante.charger() +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Classe permettant de formater du texte par exemple pour la substitution des liens dans les + * message par "[url]". + * TODO : améliorer l'efficacité des méthods notamment lié au smiles. + */ +function Formateur() +{ + this.smiles = conf.smiles + this.protocoles = "http|https|ed2k" + + this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi") + this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i") + this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://|www\\.).*?([^/.]+\\.[^/.]+)(?:$|/).*$", "i") + this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i") + this.regexNomProtocole = new RegExp("^(.*?)://") +} + +/** + * Formate un pseudo saise par l'utilisateur. + * @param pseudo le pseudo brut + * @return le pseudo filtré + */ +Formateur.prototype.filtrerInputPseudo = function(pseudo) +{ + return pseudo.replace(/{|}/g, "").trim() +} + +Formateur.prototype.getSmilesHTML = function() +{ + var XHTML = "" + for (var sNom in this.smiles) + { + XHTML += "\""" + } + return XHTML +} + +/** + * Formatage complet d'un texte. + * @M le message + * @pseudo facultatif, permet de contruire le label des images sous la forme : " : " + */ +Formateur.prototype.traitementComplet = function(M, pseudo) +{ + return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.traiterWikiSyntaxe(this.remplacerBalisesHTML(M)), pseudo))) +} + +/** + * Transforme les liens en entités clickables. + * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message : + * "{5F}" ou 5F est la racine de la conversation. + * Ce lien sera transformer en {5F} pouvant être clické pour créer la conv 5F. + */ +Formateur.prototype.traiterLiensConv = function(M) +{ + return M.replace( + /\{\w+\}/g, + function(lien) + { + return "" + lien + "" + } + ) +} + +/** + * FIXME : Cette méthode est attrocement lourde ! A optimiser. + * moyenne sur échantillon : 234ms + */ +Formateur.prototype.traiterSmiles = function(M) +{ + for (var sNom in this.smiles) + { + ss = this.smiles[sNom] + for (var i = 0; i < ss.length; i++) + M = M.replace(ss[i], "\""") + } + return M +} + +Formateur.prototype.remplacerBalisesHTML = function(M) +{ + return M.replace(//g, ">").replace(/"/g, """) +} + +Formateur.prototype.traiterURL = function(M, pseudo) +{ + thisFormateur = this + + var traitementUrl = function(url) + { + // si ya pas de protocole on rajoute "http://" + if (!thisFormateur.regexTestProtocoleExiste.test(url)) + url = "http://" + url + var extension = thisFormateur.getShort(url) + return "[" + extension[0] + "]" + } + return M.replace(this.regexUrl, traitementUrl) +} + +/** + * Formatage en utilisant un sous-ensemble des règles de mediwiki. + * par exemple ''italic'' devient italic + */ +Formateur.prototype.traiterWikiSyntaxe = function(M) +{ + return M.replace( + /'''(.*?)'''/g, + function(texte, capture) + { + return "" + capture + "" + } + ).replace( + /''(.*?)''/g, + function(texte, capture) + { + return "" + capture + "" + } + ) +} + +/** + * Renvoie une version courte de l'url. + * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient wikipedia.org + */ +Formateur.prototype.getShort = function(url) +{ + var estUneImage = false + var versionShort = null + var rechercheImg = this.regexImg.exec(url) + + if (rechercheImg != null) + { + versionShort = rechercheImg[1].toLowerCase() + if (versionShort == "jpeg") versionShort = "jpg" // jpeg -> jpg + estUneImage = true + } + else + { + var rechercheDomaine = this.regexDomaine.exec(url) + if (rechercheDomaine != null && rechercheDomaine.length >= 2) + versionShort = rechercheDomaine[1] + else + { + var nomProtocole = this.regexNomProtocole.exec(url) + if (nomProtocole != null && nomProtocole.length >= 2) + versionShort = nomProtocole[1] + } + } + + return [versionShort == null ? "url" : versionShort, estUneImage] + } + +/** + * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox. + */ +Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) +{ + thisFormateur = this + var traitementUrl = function(url) + { + return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? "*" : "") + "]" + } + + return this.remplacerBalisesHTML(M).replace(this.regexUrl, traitementUrl) +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +// les statuts possibes du client +var statutType = { + // mode enregistré, peut poster des messages et modifier son profile + auth_registered : 0, + // mode identifié, peut poster des messages mais n'a pas accès au profile + auth_not_registered : 1, + // mode déconnecté, ne peut pas poster de message + deconnected : 2 +} + +function Client(util) +{ + this.util = util + + this.cookie = null + this.regexCookie = new RegExp("^cookie=([^;]*)") + + // données personnels + this.resetDonneesPersonnelles() + + this.setStatut(statutType.deconnected) + + // si true alors chaque modification du client est mémorisé sur le serveur + this.autoflush = $.browser["opera"] +} + +Client.prototype.resetDonneesPersonnelles = function() +{ + this.id = 0 + this.pseudo = conf.pseudoDefaut + this.login = "" + this.password = "" + this.email = "" + this.css = $("link#cssPrincipale").attr("href") + this.nickFormat = "nick" + this.viewTimes = true + this.viewTooltips = true + this.cookie = undefined + + this.pagePrincipale = 1 + this.ekMaster = false + + // les conversations, une conversation est un objet possédant les attributs suivants : + // - racine (entier) + // - page (entier) + this.conversations = new Array() +} + +Client.prototype.setCss = function(css) +{ + if (this.css == css || css == "") + return + + this.css = css + $("link#cssPrincipale").attr("href", this.css) + this.majMenu() + + if (this.autoflush) this.flush(true) +} + +Client.prototype.pageSuivante = function(numConv) +{ + if (numConv < 0 && this.pagePrincipale > 1) + this.pagePrincipale -= 1 + else if (this.conversations[numConv].page > 1) + this.conversations[numConv].page -= 1 +} + +Client.prototype.pagePrecedente = function(numConv) +{ + if (numConv < 0) + this.pagePrincipale += 1 + else + this.conversations[numConv].page += 1 +} + +/** + * Définit la première page pour la conversation donnée. + * @return true si la page a changé sinon false + */ +Client.prototype.goPremierePage = function(numConv) +{ + if (numConv < 0) + { + if (this.pagePrincipale == 1) + return false + this.pagePrincipale = 1 + } + else + { + if (this.conversations[numConv].page == 1) + return false + this.conversations[numConv].page = 1 + } + return true +} + +/** + * Ajoute une conversation à la vue de l'utilisateur. + * Le profile de l'utilisateur est directement sauvegardé sur le serveur. + * @param racines la racine de la conversation (integer) + * @return true si la conversation a été créée sinon false (par exemple si la conv existe déjà) + */ +Client.prototype.ajouterConversation = function(racine) +{ + // vérification s'il elle n'existe pas déjà + for (var i = 0; i < this.conversations.length; i++) + if (this.conversations[i].root == racine) + return false + + this.conversations.push({root : racine, page : 1}) + + if (this.autoflush) this.flush(true) + + return true +} + +Client.prototype.supprimerConversation = function(num) +{ + if (num < 0 || num >= this.conversations.length) return + + // décalage TODO : supprimer le dernier élément + for (var i = num; i < this.conversations.length - 1; i++) + this.conversations[i] = this.conversations[i+1] + this.conversations.pop() + + if (this.autoflush) this.flush(true) +} + +Client.prototype.getJSONLogin = function(login, password) +{ + return { + "action" : "authentification", + "login" : login, + "password" : password + } +} + +Client.prototype.getJSONLoginCookie = function() +{ + return { + "action" : "authentification", + "cookie" : this.cookie + } +} + +/** + * le couple (login, password) est facultatif. S'il n'est pas fournit alors il ne sera pas possible + * de s'autentifier avec (login, password). + */ +Client.prototype.getJSONEnregistrement = function(login, password) +{ + var mess = { "action" : "register" } + + if (login != undefined && password != undefined) + { + mess["login"] = login + mess["password"] = password + } + + return mess; +} + +Client.prototype.getJSONConversations = function() +{ + var conversations = new Array() + for (var i = 0; i < this.conversations.length; i++) + conversations.push({ "root" : this.conversations[i].root, "page" : this.conversations[i].page}) + return conversations +} + +Client.prototype.getJSONProfile = function() +{ + return { + "action" : "set_profile", + "cookie" : this.cookie, + "login" : this.login, + "password" : this.password, + "nick" : this.pseudo, + "email" : this.email, + "css" : this.css, + "nick_format" : this.nickFormat, + "view_times" : this.viewTimes, + "view_tooltips" : this.viewTooltips, + "main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale, + "conversations" : this.getJSONConversations() + } +} + +/** + * Renvoie null si pas définit. + */ +Client.prototype.getCookie = function() +{ + var cookie = this.regexCookie.exec(document.cookie) + if (cookie == null) this.cookie = null + else this.cookie = cookie[1] +} + +Client.prototype.delCookie = function() +{ + document.cookie = "cookie=; max-age=0" +} + +Client.prototype.setCookie = function() +{ + if (this.cookie == null || this.cookie == undefined) + return + + // ne fonctionne pas sous IE.... + /*document.cookie = "cookie=" + this.cookie + "; max-age=" + (60 * 60 * 24 * 365) */ + + document.cookie = + "cookie="+this.cookie+"; expires=" + new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365).toUTCString() +} + +Client.prototype.authentifie = function() +{ + return this.statut == statutType.auth_registered || this.statut == statutType.auth_not_registered +} + +Client.prototype.setStatut = function(statut) +{ + // conversation en "enum" si en "string" + if (typeof(statut) == "string") + { + statut = + statut == "auth_registered" ? + statutType.auth_registered : + (statut == "auth_not_registered" ? statutType.auth_not_registered : statutType.deconnected) + } + + if (statut == this.statut) return + + this.statut = statut + this.majMenu() +} + +/** + * Effectue la connexion vers le serveur. + * Cette fonction est bloquante tant que la connexion n'a pas été établie. + * S'il existe un cookie en local on s'authentifie directement avec lui. + * Si il n'est pas possible de s'authentifier alors on affiche un captcha anti-bot. + */ +Client.prototype.connexionCookie = function() +{ + this.getCookie() + if (this.cookie == null) return false; + return this.connexion(this.getJSONLoginCookie()) +} + +Client.prototype.connexionLogin = function(login, password) +{ + return this.connexion(this.getJSONLogin(login, password)) +} + +Client.prototype.enregistrement = function(login, password) +{ + if (this.authentifie()) + { + this.login = login + this.password = password + if(this.flush()) + { + this.setStatut(statutType.auth_registered) + return true + } + return false + } + else + { + return this.connexion(this.getJSONEnregistrement(login, password)) + } +} + +Client.prototype.connexion = function(messageJson) +{ + ;; dumpObj(messageJson) + thisClient = this + jQuery.ajax( + { + async: false, + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction(messageJson), + success: + function(data) + { + ;; dumpObj(data) + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + else + thisClient.chargerDonnees(data) + } + } + ) + return this.authentifie() +} + +Client.prototype.deconnexion = function() +{ + this.flush(true) + this.delCookie() + this.resetDonneesPersonnelles() + this.setStatut(statutType.deconnected) // deconnexion +} + +Client.prototype.chargerDonnees = function(data) +{ + // la modification du statut qui suit met à jour le menu, le menu dépend (page admin) + // de l'état ekMaster + this.ekMaster = data["ek_master"] != undefined ? data["ek_master"] : false + + this.setStatut(data["status"]) + + if (this.authentifie()) + { + this.cookie = data["cookie"] + this.setCookie() + + this.id = data["id"] + this.login = data["login"] + this.pseudo = data["nick"] + this.email = data["email"] + this.setCss(data["css"]) + this.nickFormat = data["nick_format"] + this.viewTimes = data["view_times"] + this.viewTooltips = data["view_tooltips"] + + // la page de la conversation principale + this.pagePrincipale = data["main_page"] == undefined ? 1 : data["main_page"] + + // les conversations + this.conversations = data["conversations"] + + this.majBulle() + } +} + +/** + * Met à jour les données personne sur serveur. + * @param async de manière asynchrone ? défaut = true + * @return false si le flush n'a pas pû se faire sinon true + */ +Client.prototype.flush = function(async) +{ + if (async == undefined) + async = false + + if (!this.authentifie()) + return false + + var thisClient = this + var ok = true + + ;; dumpObj(this.getJSONProfile()) + jQuery.ajax( + { + async: async, + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction(this.getJSONProfile()), + success: + function(data) + { + ;; dumpObj(data) + if (data["reply"] == "error") + { + thisClient.util.messageDialogue(data["error_message"]) + ok = false + } + else + { + thisClient.majBulle() + } + } + } + ) + + return ok +} + +Client.prototype.majMenu = function() +{ + // TODO : à virer : ne plus changer de style de display ... spa beau .. ou trouver une autre méthode + // var displayType = this.css == "css/3/euphorik.css" ? "block" : "inline" //this.client + displayType = "block" + + $("#menu .admin").css("display", this.ekMaster ? displayType : "none") + + // met à jour le menu + if (this.statut == statutType.auth_registered) + { + $("#menu .profile").css("display", displayType).text("profile") + $("#menu .logout").css("display", displayType) + $("#menu .register").css("display", "none") + } + else if (this.statut == statutType.auth_not_registered) + { + $("#menu .profile").css("display", "none") + $("#menu .logout").css("display", displayType) + $("#menu .register").css("display", displayType) + } + else + { + $("#menu .profile").css("display", displayType).text("login") + $("#menu .logout").css("display", "none") + $("#menu .register").css("display", displayType) + } +} + +/** + * Met à jour l'affichage des infos bulles en fonction du profile. + */ +Client.prototype.majBulle = function() +{ + this.util.bulleActive = this.viewTooltips +} + +Client.prototype.slap = function(userId, raison) +{ + var thisClient = this + + jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction( + { + "action" : "slap", + "cookie" : thisClient.cookie, + "user_id" : userId, + "reason" : raison + }), + success: + function(data) + { + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + } + }) +} + +Client.prototype.ban = function(userId, raison, minutes) +{ + var thisClient = this + + // par défaut un ban correspond à 3 jours + if (typeof(minutes) == "undefined") + minutes = conf.tempsBan; + + jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction( + { + "action" : "ban", + "cookie" : thisClient.cookie, + "duration" : minutes, + "user_id" : userId, + "reason" : raison + }), + success: + function(data) + { + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + } + }) +} + +Client.prototype.kick = function(userId, raison) +{ + this.ban(userId, raison, conf.tempsKick) +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * classe permettant de gérer les événements (push serveur). + * @page la page + */ +function PageEvent(page, util) +{ + this.page = page + this.util = util + + // l'objet JSONHttpRequest représentant la connexion d'attente + this.attenteCourante = null + + // le multhreading du pauvre, merci javascript de m'offrire autant de primitives pour la gestion de la concurrence... + this.stop = false +} + +/** + * Arrête l'attente courante s'il y en a une. + */ +PageEvent.prototype.stopAttenteCourante = function() +{ + this.stop = true + + if (this.attenteCourante != null) + { + this.attenteCourante.abort() + } +} + +/** + * Attend un événement lié à la page. + * @funSend une fonction renvoyant les données json à envoyer + * @funReceive une fonction qui accepte un paramètre correspondant au données reçues + */ +PageEvent.prototype.waitEvent = function(funSend, funReceive) +{ + this.stopAttenteCourante() + + this.stop = false + + var thisPageEvent = this + + // on doit conserver l'ordre des valeurs de l'objet JSON (le serveur les veut dans l'ordre définit dans le protocole) + // TODO : ya pas mieux ? + var dataToSend = + { + "action" : "wait_event", + "page" : this.page + } + var poulpe = funSend() + for (v in poulpe) + dataToSend[v] = poulpe[v] + + ;; dumpObj(dataToSend) + + this.attenteCourante = jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction(dataToSend), + success: + function(data) + { + ;; dumpObj(data) + + funReceive(data) + + // rappel de la fonction dans 100 ms + setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funReceive) }, 100) + }, + error: + function(XMLHttpRequest, textStatus, errorThrown) + { + setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funReceive) }, 1000) + } + }) +} + +/** + * Si un stopAttenteCourante survient un peu n'importe quand il faut imédiatement arreter de boucler. + */ +PageEvent.prototype.waitEvent2 = function(funSend, funReceive) +{ + if (this.stop) + return + this.waitEvent(funSend, funReceive) +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +function initialiserListeStyles(client) +{ + $("#menuCss").change( + function() + { + client.setCss("css/" + $("option:selected", this).attr("value") + "/euphorik.css") + } + ) +} + +// charge dynamiquement le script de debug +;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"}) + +// le main +$(document).ready( + function() + { + var formateur = new Formateur() + var util = new Util(formateur) + var client = new Client(util) + var pages = new Pages() + + // connexion vers le serveur (utilise un cookie qui traine) + client.connexionCookie() + + initialiserListeStyles(client) + + // FIXME : ne fonctionne pas sous opera + // voir : http://dev.jquery.com/ticket/2892#preview + $(window).unload(function(){client.flush()}) + + $("#menu .minichat").click(function(){ pages.afficherPage("minichat") }) + $("#menu .admin").click(function(){ pages.afficherPage("admin") }) + $("#menu .profile").click(function(){ pages.afficherPage("profile") }) + $("#menu .logout").click(function(){ + util.messageDialogue("Êtes-vous sur de vouloir vous délogger ?", messageType.question, + {"Oui" : function() + { + client.deconnexion(); + pages.afficherPage("minichat", true) + }, + "Non" : function(){} + } + ) + }) + $("#menu .register").click(function(){ pages.afficherPage("register") }) + $("#menu .about").click(function(){ pages.afficherPage("about") }) + + // TODO : simplifier et pouvoir créer des liens par exemple : Conditions d'utilisation + $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation") }) + + pages.ajouterPage(new PageMinichat(client, formateur, util)) + pages.ajouterPage(new PageAdmin(client, formateur, util)) + pages.ajouterPage(new PageProfile(client, formateur, util)) + pages.ajouterPage(new PageRegister(client, formateur, util)) + pages.ajouterPage(new PageAbout(client, formateur, util)) + pages.ajouterPage("conditions_utilisation") + + pages.afficherPage("minichat") + } +) diff --git a/js/jquery.js b/js/jquery.js new file mode 100755 index 0000000..88e661e --- /dev/null +++ b/js/jquery.js @@ -0,0 +1,3549 @@ +(function(){ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ + +// Map over jQuery in case of overwrite +var _jQuery = window.jQuery, +// Map over the $ in case of overwrite + _$ = window.$; + +var jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); +}; + +// A simple way to check for HTML strings or ID strings +// (both of which we optimize for) +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, + +// Is it a simple selector + isSimple = /^.[^:#\[\.]*$/, + +// Will speed up references to undefined, and allows munging its name. + undefined; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + return this; + } + // Handle HTML strings + if ( typeof selector == "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Make sure an element was located + if ( elem ){ + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + return jQuery( elem ); + } + selector = []; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray(jQuery.makeArray(selector)); + }, + + // The current version of jQuery being used + jquery: "1.2.6", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // The number of elements contained in the matched element set + length: 0, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + var ret = -1; + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( name.constructor == String ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text != "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) + // The elements to wrap the target around + jQuery( html, this[0].ownerDocument ) + .clone() + .insertBefore( this[0] ) + .map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, false, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, true, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + find: function( selector ) { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); + + return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + jQuery.unique( elems ) : + elems ); + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var clone = this.cloneNode(true), + container = document.createElement("div"); + container.appendChild(clone); + return jQuery.clean([container.innerHTML])[0]; + } else + return this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if ( events === true ) + this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; + var events = jQuery.data( this, "events" ); + + for ( var type in events ) + for ( var handler in events[ type ] ) + jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); + }); + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, this ) ); + }, + + not: function( selector ) { + if ( selector.constructor == String ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector == 'string' ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return this.is( "." + selector ); + }, + + val: function( value ) { + if ( value == undefined ) { + + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + + // Everything else, we just grab the value + } else + return (this[0].value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if( value.constructor == Number ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value == undefined ? + (this[0] ? + this[0].innerHTML : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + data: function( key, value ){ + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) + data = jQuery.data( this[0], key ); + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ + jQuery.data( this, key, value ); + }); + }, + + removeData: function( key ){ + return this.each(function(){ + jQuery.removeData( this, key ); + }); + }, + + domManip: function( args, table, reverse, callback ) { + var clone = this.length > 1, elems; + + return this.each(function(){ + if ( !elems ) { + elems = jQuery.clean( args, this.ownerDocument ); + + if ( reverse ) + elems.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); + + var scripts = jQuery( [] ); + + jQuery.each(elems, function(){ + var elem = clone ? + jQuery( this ).clone( true )[0] : + this; + + // execute all scripts after the elements have been injected + if ( jQuery.nodeName( elem, "script" ) ) + scripts = scripts.add( elem ); + else { + // Remove any inner scripts for later evaluation + if ( elem.nodeType == 1 ) + scripts = scripts.add( jQuery( "script", elem ).remove() ); + + // Inject the elements into the document + callback.call( obj, elem ); + } + }); + + scripts.each( evalScript ); + }); + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target != "object" && typeof target != "function" ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy == "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + now(), uuid = 0, windowData = {}, + // exclude the following css properties to add px + exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning this function. + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + data = jQuery.trim( data ); + + if ( data ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.browser.msie ) + script.text = data; + else + script.appendChild( document.createTextNode( data ) ); + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? + jQuery.cache[ id ][ name ] : + id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + + for ( name in jQuery.cache[ id ] ) + break; + + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length == undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length == undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames != undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + var padding = 0, border = 0; + jQuery.each( which, function() { + padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + val -= Math.round(padding + border); + } + + if ( jQuery(elem).is(":visible") ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, val); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // A helper method for determining if an element's values are broken + function color( elem ) { + if ( !jQuery.browser.safari ) + return false; + + // defaultView is cached + var ret = defaultView.getComputedStyle( elem, null ); + return !ret || ret.getPropertyValue("color") == ""; + } + + // We need to handle opacity special in IE + if ( name == "opacity" && jQuery.browser.msie ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + // Opera sometimes will give the wrong display answer, this fixes it, see #2037 + if ( jQuery.browser.opera && name == "display" ) { + var save = style.outline; + style.outline = "0 solid black"; + style.outline = save; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var computedStyle = defaultView.getComputedStyle( elem, null ); + + if ( computedStyle && !color( elem ) ) + ret = computedStyle.getPropertyValue( name ); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + var swap = [], stack = [], a = elem, i = 0; + + // Locate all of the parent display: none elements + for ( ; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( ; i < stack.length; i++ ) + if ( color( stack[ i ] ) ) { + swap[ i ] = stack[ i ].style.display; + stack[ i ].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = name == "display" && swap[ stack.length - 1 ] != null ? + "none" : + ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; + + // Finally, revert the display styles back + for ( i = 0; i < swap.length; i++ ) + if ( swap[ i ] != null ) + stack[ i ].style.display = swap[ i ]; + } + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context ) { + var ret = []; + context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement == 'undefined') + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + jQuery.each(elems, function(i, elem){ + if ( !elem ) + return; + + if ( elem.constructor == Number ) + elem += ''; + + // Convert html string into DOM nodes + if ( typeof elem == "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and