Author: fdesbois Date: 2012-04-17 18:08:36 +0200 (Tue, 17 Apr 2012) New Revision: 3282 Url: http://chorem.org/repositories/revision/pollen/3282 Log: add tooltip infos Added: trunk/pollen-ui-struts2/src/main/webapp/css/tipTip.css trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png trunk/pollen-ui-struts2/src/main/webapp/js/jquery.tipTip.minified.js Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp trunk/pollen-ui-struts2/src/main/webapp/css/common.css trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-17 16:08:36 UTC (rev 3282) @@ -67,6 +67,7 @@ pollen.common.email=Em@il pollen.common.endChoiceDate=end choice date pollen.common.endDate=End date +pollen.common.favoriteList.csvImport.help=The file to upload is a text file that contains one row per participant.<br/><br/>The first line must be <strong>votingId,email</strong>, then each next ones will define the participant's name and his email separated by a comma.<br/><br/>Here is an example \:<br/> pollen.common.firstName=First name pollen.common.functions=Functions pollen.common.group=group @@ -86,17 +87,26 @@ pollen.common.personToList=Voter pollen.common.pollCreator=Creator pollen.common.pollOption.anonymous=Anonymous +pollen.common.pollOption.anonymous.help=Voting persons and their votes are anonymous pollen.common.pollOption.anonymousVoteAllowed=Anonymous vote allowed +pollen.common.pollOption.anonymousVoteAllowed.help=Voting persons can be anonymous pollen.common.pollOption.choiceAddAllowed=Allow adding choices +pollen.common.pollOption.choiceAddAllowed.help=You can add choices to the poll pollen.common.pollOption.continuousResults=Continous results +pollen.common.pollOption.continuousResults.help=Poll results are displayed continuously during the vote pollen.common.pollOption.limitChoice=Limit number of choice per vote +pollen.common.pollOption.limitChoice.help=The user can select a limited number of choices pollen.common.pollOption.maxChoiceNb=Limit pollen.common.pollOption.notification=Receive notification emails +pollen.common.pollOption.notification.help=An email is sent to you for each vote pollen.common.pollOption.notificationNumber=After each n votes pollen.common.pollOption.publicResults=Public results +pollen.common.pollOption.publicResults.help=Poll results are available for everybody pollen.common.pollOption.reminder=Send reminder emails +pollen.common.pollOption.reminder.help=An email is sent to remind persons who have not yet voted N hours before poll end pollen.common.pollOption.reminderHourCountdown=Hours before end pollen.common.pollType=Who can vote ? +pollen.common.pollType.help=Free\: accessible to everyone <br/><br/> Restricted\: accessible only to a list of persons <br/><br/> Group\: accessible to several lists of persons pollen.common.postDate=Comment date pollen.common.results=Results\: pollen.common.select.choiceType=Select the type of choice @@ -112,6 +122,7 @@ pollen.common.voteAction=Vote pollen.common.voteCounting-label=Vote Counting\: pollen.common.voteCountingType=Response type +pollen.common.voteCountingType.help=Normal\: selecting 1 to n choices among available choices <br/><br/> Percentage\: allocating a percentage to each choice <br/><br/> Condorcet\: ranking choices in order of preference <br/><br/> Number \: Free response. Summed and the average numbers. pollen.common.voteCountingTypeHelp.condorcet=Condorcet vote\: rank choices by preference order from 1 to N (1\=favorite). Only the rank is taken into account, not the values. Two choices can have the same value. pollen.common.voteCountingTypeHelp.normal=Normal vote\: vote for your favorite choice. pollen.common.voteCountingTypeHelp.number=Voting by number\: The answer is free, leave blank or enter a integer. Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-17 16:08:36 UTC (rev 3282) @@ -72,6 +72,7 @@ pollen.common.email=Em@il pollen.common.endChoiceDate=Date de fin des choix pollen.common.endDate=Date de fin +pollen.common.favoriteList.csvImport.help=Le fichier à importer doit être un fichier texte contenant une ligne par participant.<br/><br/>La première ligne doit contenir <strong>votingId,email</strong>, ensuite chacune des suivantes définira le nom du participant et son email séparés par une virgule.<br/><br/>Voici un exemple \:<br/> pollen.common.firstName=Prénom pollen.common.functions=Fonctions pollen.common.group=groupes @@ -93,17 +94,25 @@ pollen.common.personToList=Votant pollen.common.pollCreator=Créateur pollen.common.pollOption.anonymous=Sondage anonyme +pollen.common.pollOption.anonymous.help=Les votants ainsi que leurs votes sont anonymes pollen.common.pollOption.anonymousVoteAllowed=Autoriser le vote anonyme +pollen.common.pollOption.anonymousVoteAllowed.help=Les votants peuvent être anonymes pollen.common.pollOption.choiceAddAllowed=Autoriser l'ajout de choix +pollen.common.pollOption.choiceAddAllowed.help=Il est possible d'ajouter des choix au sondage pollen.common.pollOption.continuousResults=Résultats continus +pollen.common.pollOption.continuousResults.help=Les résultats du sondage sont affichés en continu au moment du vote pollen.common.pollOption.limitChoice=Limiter le nombre de choix par vote +pollen.common.pollOption.limitChoice.help=Le nombre de choix que l'utilisateur peut sélectionner est limité pollen.common.pollOption.maxChoiceNb=Limite pollen.common.pollOption.notification=Recevoir des emails de notification -pollen.common.pollOption.notificationNumber=Tous les n votes +pollen.common.pollOption.notification.help=Un email vous est envoyé à chaque vote pollen.common.pollOption.publicResults=Résultats publics +pollen.common.pollOption.publicResults.help=Les résultats du sondage sont consultables par tout le monde pollen.common.pollOption.reminder=Envoyer des emails de rappel +pollen.common.pollOption.reminder.help=Un email de rappel est envoyé aux votants qui n'ont pas encore voté N heures avant la fin du sondage pollen.common.pollOption.reminderHourCountdown=heures avant la fin du sondage pollen.common.pollType=Qui peut voter ? +pollen.common.pollType.help=Libre \: accessible à tout le monde <br/><br/> Restreint \: accessible uniquement à une liste de votants <br/><br/> Groupe \: accessible à plusieurs listes de votants pollen.common.postDate=Date du commentaire pollen.common.results=Résultats \: pollen.common.select.choiceType=Sélectionner le type de choix @@ -118,6 +127,7 @@ pollen.common.vote.return-help=Retour au sondage pollen.common.voteAction=Vote pollen.common.voteCountingType=Type de Réponse +pollen.common.voteCountingType.help=Normal \: sélection de 1 ou n choix parmis les choix possibles <br/><br/> Pourcentage \: attribution d'un pourcentage à chaque choix <br/><br/> Condorcet \: classement des choix par ordre de préférence <br/><br/> Nombre \: Réponse libre. Fait la somme et la moyenne des nombres pollen.common.voteCountingTypeHelp.condorcet=Vote Condorcet \: classer les choix par ordre de préférence de 1 à N (1\=préféré). Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur. pollen.common.voteCountingTypeHelp.normal=Vote normal \: voter pour le ou les choix préférés. pollen.common.voteCountingTypeHelp.number=Vote par nombre \: La réponse est libre, laissez vide ou entrez un nombre entier Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-17 16:08:36 UTC (rev 3282) @@ -26,6 +26,8 @@ <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <link rel="stylesheet" type="text/css" href="<s:url value='/css/pollCreation.css'/>"/> +<link rel="stylesheet" type="text/css" + href="<s:url value='/css/tipTip.css'/>"/> <script type="text/javascript"> @@ -60,6 +62,8 @@ <script type="text/javascript" src='<s:url value="/js/createPoll.js"/>'></script> +<script type="text/javascript" + src='<s:url value="/js/jquery.tipTip.minified.js"/>'></script> <s:url id='errorImg' value='/img/exclamation.png'/> @@ -92,7 +96,11 @@ <br/> <fieldset> - <legend><s:text name="pollen.common.voteCountingType"/></legend> + <legend> + <s:text name="pollen.common.voteCountingType"/> + <img src="<s:url value='/img/tooltip.png'/>" class="tooltip" + title="<s:text name='pollen.common.voteCountingType.help'/>"/> + </legend> <s:radio key='poll.voteCountingType' list="voteCountingTypes" label='' theme="simple" disabled="%{voteStarted}"/> </fieldset> @@ -124,17 +132,27 @@ <s:checkbox key="poll.anonymous" label="%{getText('pollen.common.pollOption.anonymous')}" - disabled="%{voteStarted}"/> + disabled="%{voteStarted}" + tooltip="%{getText('pollen.common.pollOption.anonymous.help')}" + tooltipIconPath="/img/tooltip.png"/> <s:checkbox key="poll.anonymousVoteAllowed" label="%{getText('pollen.common.pollOption.anonymousVoteAllowed')}" - disabled="%{voteStarted}"/> + disabled="%{voteStarted}" + tooltip="%{getText('pollen.common.pollOption.anonymousVoteAllowed.help')}" + tooltipIconPath="/img/tooltip.png"/> <s:checkbox key="poll.continuousResults" - label="%{getText('pollen.common.pollOption.continuousResults')}"/> + label="%{getText('pollen.common.pollOption.continuousResults')}" + tooltip="%{getText('pollen.common.pollOption.continuousResults.help')}" + tooltipIconPath="/img/tooltip.png"/> <s:checkbox key="poll.publicResults" - label="%{getText('pollen.common.pollOption.publicResults')}"/> + label="%{getText('pollen.common.pollOption.publicResults')}" + tooltip="%{getText('pollen.common.pollOption.publicResults.help')}" + tooltipIconPath="/img/tooltip.png"/> <s:checkbox key="poll.choiceAddAllowed" label="%{getText('pollen.common.pollOption.choiceAddAllowed')}" - disabled="%{voteStarted}"/> + disabled="%{voteStarted}" + tooltip="%{getText('pollen.common.pollOption.choiceAddAllowed.help')}" + tooltipIconPath="/img/tooltip.png"/> <div id='addChoiceAddAllowedPanel' class="hidden"> <sj:datepicker key="poll.beginChoiceDate" label="%{getText('pollen.common.beginChoiceDate')}" @@ -147,16 +165,22 @@ </div> <s:checkbox key="limitChoice" label="%{getText('pollen.common.pollOption.limitChoice')}" - disabled="%{voteStarted}"/> + disabled="%{voteStarted}" + tooltip="%{getText('pollen.common.pollOption.limitChoice.help')}" + tooltipIconPath="/img/tooltip.png"/> <div id='maxChoiceNbPanel' class="hidden"> <s:textfield key="poll.maxChoiceNb" label="%{getText('pollen.common.pollOption.maxChoiceNb')}" disabled="%{voteStarted}"/> </div> <s:checkbox key="notification" - label="%{getText('pollen.common.pollOption.notification')}"/> + label="%{getText('pollen.common.pollOption.notification')}" + tooltip="%{getText('pollen.common.pollOption.notification.help')}" + tooltipIconPath="/img/tooltip.png"/> <s:checkbox key="reminder" - label="%{getText('pollen.common.pollOption.reminder')}"/> + label="%{getText('pollen.common.pollOption.reminder')}" + tooltip="%{getText('pollen.common.pollOption.reminder.help')}" + tooltipIconPath="/img/tooltip.png"/> <div id='reminderPanel' class="hidden"> <s:textfield key="reminderHourCountdown" label="%{getText('pollen.common.pollOption.reminderHourCountdown')}"/> @@ -179,7 +203,11 @@ <br/> <fieldset> - <legend><s:text name="pollen.common.pollType"/></legend> + <legend> + <s:text name="pollen.common.pollType"/> + <img src="<s:url value='/img/tooltip.png'/>" class="tooltip" + title="<s:text name='pollen.common.pollType.help'/>"/> + </legend> <s:radio key='poll.pollType' list="pollTypes" label='%{getText("pollen.common.pollType")}' disabled="%{voteStarted}"/> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-04-17 16:08:36 UTC (rev 3282) @@ -25,11 +25,16 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<link rel="stylesheet" type="text/css" + href="<s:url value='/css/tipTip.css'/>"/> + <script type="text/javascript" src="<s:url value='/js/gridHelper.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/favoriteLists.js' />"></script> +<script type="text/javascript" + src="<s:url value='/js/jquery.tipTip.minified.js' />"></script> <title><s:text name="pollen.title.favoriteLists"/></title> @@ -46,6 +51,8 @@ var editImg = '<s:url value='/img/edit.png'/>'; var editTitle = '<s:text name="pollen.action.editFavoriteList"/>'; var deleteImg = '<s:url value='/img/delete.png'/>'; + var csvHelp = '<div><s:text name="pollen.common.favoriteList.csvImport.help"/>' + + '<br/><img src="<s:url value="/img/import_csv_help.png"/>"/></div>' jQuery(document).ready(function () { Modified: trunk/pollen-ui-struts2/src/main/webapp/css/common.css =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/css/common.css 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/webapp/css/common.css 2012-04-17 16:08:36 UTC (rev 3282) @@ -144,4 +144,30 @@ padding-left: 25px; color: #880000; margin-left:0px; -} \ No newline at end of file +} +#tooltip { + position:absolute; + z-index:9999; + color:#fff; + font-size:10px; + width:180px; + + } + + #tooltip .tipHeader { + height:8px; + background:url(images/tipHeader.gif) no-repeat; + } + + /* IE hack */ + *html #tooltip .tipHeader {margin-bottom:-6px;} + + #tooltip .tipBody { + background-color:#000; + padding:5px; + } + + #tooltip .tipFooter { + height:8px; + background:url(images/tipFooter.gif) no-repeat; + } \ No newline at end of file Added: trunk/pollen-ui-struts2/src/main/webapp/css/tipTip.css =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/css/tipTip.css (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/css/tipTip.css 2012-04-17 16:08:36 UTC (rev 3282) @@ -0,0 +1,113 @@ +/* TipTip CSS - Version 1.2 */ + +#tiptip_holder { + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 99999; +} + +#tiptip_holder.tip_top { + padding-bottom: 5px; +} + +#tiptip_holder.tip_bottom { + padding-top: 5px; +} + +#tiptip_holder.tip_right { + padding-left: 5px; +} + +#tiptip_holder.tip_left { + padding-right: 5px; +} + +#tiptip_content { + font-size: 11px; + color: #fff; + text-shadow: 0 0 2px #000; + padding: 4px 8px; + border: 1px solid rgba(255,255,255,0.25); + background-color: rgb(25,25,25); + background-color: rgba(25,25,25,0.92); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000)); + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + box-shadow: 0 0 3px #555; + -webkit-box-shadow: 0 0 3px #555; + -moz-box-shadow: 0 0 3px #555; +} + +#tiptip_arrow, #tiptip_arrow_inner { + position: absolute; + border-color: transparent; + border-style: solid; + border-width: 6px; + height: 0; + width: 0; +} + +#tiptip_holder.tip_top #tiptip_arrow { + border-top-color: #fff; + border-top-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_bottom #tiptip_arrow { + border-bottom-color: #fff; + border-bottom-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_right #tiptip_arrow { + border-right-color: #fff; + border-right-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_left #tiptip_arrow { + border-left-color: #fff; + border-left-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_top #tiptip_arrow_inner { + margin-top: -7px; + margin-left: -6px; + border-top-color: rgb(25,25,25); + border-top-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_bottom #tiptip_arrow_inner { + margin-top: -5px; + margin-left: -6px; + border-bottom-color: rgb(25,25,25); + border-bottom-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_right #tiptip_arrow_inner { + margin-top: -6px; + margin-left: -5px; + border-right-color: rgb(25,25,25); + border-right-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_left #tiptip_arrow_inner { + margin-top: -6px; + margin-left: -7px; + border-left-color: rgb(25,25,25); + border-left-color: rgba(25,25,25,0.92); +} + +/* Webkit Hacks */ +@media screen and (-webkit-min-device-pixel-ratio:0) { + #tiptip_content { + padding: 4px 8px 5px 8px; + background-color: rgba(45,45,45,0.88); + } + #tiptip_holder.tip_bottom #tiptip_arrow_inner { + border-bottom-color: rgba(45,45,45,0.88); + } + #tiptip_holder.tip_top #tiptip_arrow_inner { + border-top-color: rgba(20,20,20,0.92); + } +} \ No newline at end of file Added: trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png 2012-04-17 16:08:36 UTC (rev 3282) @@ -0,0 +1,9 @@ +�PNG + + +IHDR��asRGB���bKGD������� pHYs���+tIME�8Vڳ�IDAT8˥��K�Q���;�4_�Ѳ,J�+$J�fP�(��)�hSA�*�V�-�MB""b� ++!��,Ê4G�)����Fc�M=��9~�y��(�S�_,RFz�����_�ȵq/�Żd�_������ ���D<��b��|�/1}}x<�w��D��5��s���v +�Bz;���*Ep�zL����Fv���������ܹF*XLn��L�}'�9�D��&��q��bWU�[�����L���n'O2="��C7I6"r|/іO��6�6$��_��,bm�� ��ᯬD��A��(@wv��茐~����Ռ>gglo �z?�Q�(A��6�˖���w�R�o� +I +eǨ��Q�(����؍G�t�c��`�ZP��&0y6����R��茠����4CZ'qG��+#��*(������<�=��|o�i���D�"������/+�sWE�7g����&��C��ߑZ��+�����"Jl�g���x"�� +uY���iVў�D_v2��{�|�maJ*�me�E�����)n��o_y���^<���QT]�?�HE��|B<#t�w=+�?���� yf��mң�<�Bfm�����x���e���\�F�V/[�IEND�B`� \ No newline at end of file Modified: trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-04-17 16:08:36 UTC (rev 3282) @@ -578,4 +578,8 @@ changeChoiceType(datas['choiceType']); changePollType(datas['pollType']); + + $('.tooltip').tipTip({ + defaultPosition : 'top' + }); }); \ No newline at end of file Modified: trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js 2012-04-17 13:08:52 UTC (rev 3281) +++ trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js 2012-04-17 16:08:36 UTC (rev 3282) @@ -56,6 +56,12 @@ $('#deleteForm').hide(); $('#createForm').show(); }); + + $('[name=csvImport]').tipTip({ + content : csvHelp, + maxWidth : '340px', + defaultPosition : 'right' + }); } function favoriteListsFunctions(cellvalue, options, rowObject) { Added: trunk/pollen-ui-struts2/src/main/webapp/js/jquery.tipTip.minified.js =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/js/jquery.tipTip.minified.js (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/js/jquery.tipTip.minified.js 2012-04-17 16:08:36 UTC (rev 3282) @@ -0,0 +1,21 @@ + /* + * TipTip + * Copyright 2010 Drew Wilson + * www.drewwilson.com + * code.drewwilson.com/entry/tiptip-jquery-plugin + * + * Version 1.3 - Updated: Mar. 23, 2010 + * + * This Plug-In will create a custom tooltip to replace the default + * browser tooltip. It is extremely lightweight and very smart in + * that it detects the edges of the browser window and will make sure + * the tooltip stays within the current window size. As a result the + * tooltip will adjust itself to be displayed above, below, to the left + * or to the right depending on what is necessary to stay within the + * browser window. It is completely customizable as well via CSS. + * + * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery); \ No newline at end of file