Changeset 10305 for trunk


Ignore:
Timestamp:
Apr 12, 2011, 2:30:28 AM (13 years ago)
Author:
mistic100
Message:

new plugins manager, update TipTip in v1.3

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugins_list.php

    r10293 r10305  
    3131$template->set_filenames(array('plugins' => 'plugins_list.tpl'));
    3232
    33 $base_url = get_root_url().'admin.php?page='.$page['page'];
    34 $action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.get_pwg_token();
     33// TODO : use a session parameter
     34$plugin_order = isset($_GET['plugin_order']) ? $_GET['plugin_order'] : 'state';
     35$plugin_display = isset($_GET['plugin_display']) ? $_GET['plugin_display'] : 'compact';
     36
     37$base_url = get_root_url().'admin.php?page='.$page['page'].'&plugin_order='.$plugin_order.'&plugin_display='.$plugin_display;
     38$pwg_token = get_pwg_token();
     39$action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.$pwg_token;
    3540
    3641$plugins = new plugins();
     
    7176$plugins->get_incompatible_plugins();
    7277$merged_plugins = false;
     78$tpl_plugins = array();
    7379
    7480foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
     
    8288
    8389  $tpl_plugin = array(
     90    'ID' => $plugin_id,
    8491    'NAME' => $fs_plugin['name'],
    8592    'VISIT_URL' => $fs_plugin['uri'],
     
    109116  }
    110117
    111   $template->append('plugins', $tpl_plugin);
     118  array_push($tpl_plugins, $tpl_plugin);
    112119}
    113120
     
    129136  foreach($missing_plugin_ids as $plugin_id)
    130137  {
    131     $template->append(
    132       'plugins',
     138    array_push(
     139      $tpl_plugins,
    133140      array(
    134141        'NAME' => $plugin_id,
     
    143150}
    144151
     152// sort plugins : state or name
     153if ($plugin_order == 'name')
     154{
     155  function cmp($a, $b)
     156  {
     157    return strcasecmp($a['NAME'], $b['NAME']);
     158  }
     159}
     160else
     161{
     162  function cmp($a, $b)
     163  {
     164    $s = array('merged' => 0, 'missing' => 1, 'active' => 2, 'inactive' => 3);
     165   
     166    if($a['STATE'] == $b['STATE'])
     167      return strcasecmp($a['NAME'], $b['NAME']);
     168    else
     169      return $s[$a['STATE']] >= $s[$b['STATE']];
     170  }
     171  $plugin_order = 'state';
     172}
     173
     174usort($tpl_plugins, 'cmp');
     175$template->assign(array(
     176  'plugin_order' => $plugin_order,
     177  'plugin_display' => $plugin_display,
     178  'plugins' => $tpl_plugins,
     179  'PWG_TOKEN' => $pwg_token,
     180));
     181
    145182$template->assign_var_from_handle('ADMIN_CONTENT', 'plugins');
    146183?>
  • trunk/admin/themes/clear/theme.css

    r9815 r10305  
    256256#footer { background-image: url(images/piwigo_logo_small.png);}
    257257
    258 .pluginBox {background-color:#ddd;color:#333}
    259 .pluginBoxNameCell {font-weight:bold;}
     258.pluginBox, .pluginMiniBox {background-color:#ddd;color:#353535;border:1px solid #ddd;}
     259.pluginBoxNameCell, .pluginMiniBoxNameCell {color:#111;}
     260.pluginBox.active, .pluginMiniBox.active {border-color:#666;background-color:#dadada;}
     261.pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#a00 !important;}
     262.pluginBox.missing, .pluginBox.merged, .pluginMiniBox.missing, .pluginMiniBox.merged {background-color:#d99;border:1px solid #a00;}
     263.plugin-delete {color:#f00;}
    260264
    261265.languageBox {background-color:#ddd;}
     
    263267.languageDefault {background-color:#dbe8f3;}
    264268
    265 UL.thumbnails li.rank-of-image {
    266   background-color: #ddd;
    267 }
     269UL.thumbnails li.rank-of-image {background-color: #ddd;}
    268270
    269271#batchManagerGlobal ul.thumbnails span.wrap2 {background-color:#ddd;}
  • trunk/admin/themes/default/template/plugins_list.tpl

    r10293 r10305  
    1 {footer_script}
     1{combine_script id='jquery.ajaxmanager' load='footer' require='jquery' path='themes/default/js/plugins/jquery.ajaxmanager.js' }
     2
     3{footer_script require='jquery.ajaxmanager'}
     4/* incompatible message */
    25var incompatible_msg = '{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'javascript'}';
    36incompatible_msg += '\n';
    47incompatible_msg += '{'Do you want to activate anyway?'|@translate|@escape:'javascript'}';
    58
     9/* group action */
     10var pwg_token = '{$PWG_TOKEN}';
     11var confirmMsg  = '{'Are you sure?'|@translate|@escape:'javascript'}';
    612{literal}
     13var queuedManager = jQuery.manageAjax.create('queued', {
     14  queue: true, 
     15  maxRequests: 1,
     16  complete: function() { location.reload(); }
     17});
     18
    719jQuery(document).ready(function() {
    8   jQuery('.incompatible').click(function() {
     20  /* group action */
     21  jQuery('a.deactivate_all').click(function() {
     22    if (confirm(confirmMsg)) {
     23      jQuery('div.active').each(function() {
     24        performPluginAction(jQuery(this).attr('id'), 'deactivate');
     25      });
     26    }
     27  });
     28  jQuery('a.activate_all').click(function() {
     29    if (confirm(confirmMsg)) {
     30      jQuery('div.inactive').each(function() {
     31        performPluginAction(jQuery(this).attr('id'), 'activate');
     32      });
     33    }
     34  });
     35  function performPluginAction(id, action) {
     36   queuedManager.add({
     37      type: 'GET',
     38      dataType: 'json',
     39      url: 'ws.php',
     40      data: { method: 'pwg.plugins.performAction', action: action, plugin: id, pwg_token: pwg_token, format: 'json' },
     41      success: function(data) {
     42        if (data['stat'] == 'ok') {
     43          if (action == 'deactivate')
     44            jQuery("#"+id).removeClass('active').addClass('inactive');
     45          else
     46            jQuery("#"+id).removeClass('inactive').addClass('active');
     47        }
     48      }
     49    });
     50  };
     51
     52  /* incompatible message */
     53  jQuery('.incompatible a.incompatible').click(function() {
    954    return confirm(incompatible_msg);
    1055  });
     56 
     57  /* TipTips */
    1158  jQuery('.warning').tipTip({
    1259    'delay' : 0,
    1360    'fadeIn' : 200,
    14     'fadeOut' : 200
     61    'fadeOut' : 200,
     62    'maxWidth':'250px'
     63  }).click(function(){
     64    return false;
     65  });
     66  jQuery('.pluginMiniBoxDesc').tipTip({
     67    'delay' : 0,
     68    'fadeIn' : 200,
     69    'fadeOut' : 200,
     70    'maxWidth':'300px', /* not effective, TipTip bug */
     71    'keepAlive':true
     72  }).click(function(){
     73    return false;
    1574  });
    1675});
    17 {/literal}{/footer_script}
     76{/literal}
     77{/footer_script}
    1878
    1979<div class="titrePage">
     80  <span class="sort">
     81    <form action="" method="get" name="change_order">
     82      <input type="hidden" name="page" value="plugins_list"/>
     83      {'Sort order'|@translate} :
     84      <select name="plugin_order" onchange="this.form.submit();">
     85        <option value="status" {if $plugin_order=='state'}selected="selected"{/if}>{'Status'|@translate}</option>
     86        <option value="name" {if $plugin_order=='name'}selected="selected"{/if}>{'Name'|@translate}</option>
     87      </select>
     88      &nbsp;&nbsp;|&nbsp;&nbsp;
     89      {'Display'|@translate} :
     90      <select name="plugin_display" onchange="this.form.submit();">
     91        <option value="compact" {if $plugin_diplay=='compact'}selected="selected"{/if}>{'Compact'|@translate}</option>
     92        <option value="complete" {if $plugin_display=='complete'}selected="selected"{/if}>{'Complete'|@translate}</option>
     93      </select>
     94      &nbsp;&nbsp;|&nbsp;&nbsp;
     95      <a class="deactivate_all">{'Deactivate'|@translate} {'all'|@translate}</a>
     96      {* &nbsp;&nbsp;|&nbsp;&nbsp;
     97      <a class="activate_all">{'Activate'|@translate} {'all'|@translate}</a> *}
     98    </form>
     99  </span>
    20100  <h2>{'Plugins'|@translate}</h2>
    21101</div>
     
    23103{if isset($plugins)}
    24104
    25 {foreach from=$plugin_states item=plugin_state}
    26 <fieldset>
    27   <legend>
    28   {if $plugin_state == 'active'}
    29   {'Active Plugins'|@translate}
    30 
    31   {elseif $plugin_state == 'inactive'}
    32   {'Inactive Plugins'|@translate}
    33 
    34   {elseif $plugin_state == 'missing'}
    35   {'Missing Plugins'|@translate}
    36 
    37   {elseif $plugin_state == 'merged'}
    38   {'Obsolete Plugins'|@translate}
    39 
     105{assign var='field_name' value='null'}
     106{foreach from=$plugins item=plugin name=plugins_loop}
     107   
     108{if $plugin_order == 'state' AND $field_name != $plugin.STATE}
     109  {if $field_name != 'null'}</fieldset>{/if}
     110  <fieldset class="pluginBoxes pluginsByState">
     111    <legend>
     112    {if $plugin.STATE == 'active'}
     113      {'Active Plugins'|@translate}
     114    {elseif $plugin.STATE == 'inactive'}
     115      {'Inactive Plugins'|@translate}
     116    {elseif $plugin.STATE == 'missing'}
     117      {'Missing Plugins'|@translate}
     118    {elseif $plugin.STATE == 'merged'}
     119      {'Obsolete Plugins'|@translate}
     120    {/if}
     121    </legend>
     122  {assign var='field_name' value=$plugin.STATE}
     123
     124{elseif $field_name == 'null'}
     125  <fieldset class="pluginBoxes pluginsByName">
     126  {assign var='field_name' value='not_null'}
     127
     128{/if}
     129
     130  {if not empty($plugin.AUTHOR)}
     131    {if not empty($plugin.AUTHOR_URL)}
     132      {assign var='author' value="<a href='%s'>%s</a>"|@sprintf:$plugin.AUTHOR_URL:$plugin.AUTHOR}
     133    {else}
     134      {assign var='author' value='<u>'|cat:$plugin.AUTHOR|cat:'</u>'}
     135    {/if}
    40136  {/if}
    41   </legend>
    42   {foreach from=$plugins item=plugin name=plugins_loop}
    43     {if $plugin.STATE == $plugin_state}
    44   <div class="pluginBox">
    45     <table>
    46       <tr>
    47         <td class="pluginBoxNameCell{if $plugin.INCOMPATIBLE} warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}{/if}">
    48           {$plugin.NAME}
    49         </td>
    50         <td>{$plugin.DESC}</td>
    51       </tr>
    52       <tr>
    53         <td>
    54     {if $plugin.STATE == 'active'}
     137   
     138  {if $plugin_display == 'complete'}
     139    <div id="{$plugin.ID}" class="pluginBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">
     140      <table>
     141        <tr>
     142          <td class="pluginBoxNameCell">
     143            {if $plugin.INCOMPATIBLE}<a class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></a>{/if}
     144            {$plugin.NAME}
     145          </td>
     146          <td>{$plugin.DESC}</td>
     147        </tr>
     148        <tr>
     149          <td>
     150          {if $plugin.STATE == 'active'}
     151            <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
     152            | <a href="{$plugin.U_ACTION}&amp;action=restore" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
     153
     154          {elseif $plugin.STATE == 'inactive'}
     155            <a href="{$plugin.U_ACTION}&amp;action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>
     156            | <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
     157
     158          {elseif $plugin.STATE == 'missing'}
     159            <a href="{$plugin.U_ACTION}&amp;action=uninstall" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
     160
     161          {elseif $plugin.STATE == 'merged'}
     162            <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete">{'Delete'|@translate}</a>
     163          {/if}
     164          </td>
     165          <td>
     166            {'Version'|@translate} {$plugin.VERSION}
     167           
     168          {if not empty($author)}
     169            | {'By %s'|@translate|@sprintf:$author}
     170          {/if}
     171
     172          {if not empty($plugin.VISIT_URL)}
     173            | <a class="externalLink" href="{$plugin.VISIT_URL}">{'Visit plugin site'|@translate}</a>
     174          {/if}
     175          </td>
     176        </tr>
     177      </table>
     178    </div> {*<!-- pluginBox -->*}
     179   
     180  {elseif $plugin_display == 'compact'}
     181    {if not empty($plugin.VISIT_URL)}
     182      {assign var='version' value="<a class='externalLink' href='"|cat:$plugin.VISIT_URL|cat:"'>"|cat:$plugin.VERSION|cat:"</a>"}
     183    {else
     184      {assign var='version' value=$plugin.VERSION}
     185    {/if}
     186         
     187    <div id="{$plugin.ID}" class="pluginMiniBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">
     188      <div class="pluginMiniBoxNameCell">
     189        {if $plugin.INCOMPATIBLE}<a class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></a>{/if}
     190        {$plugin.NAME}
     191        <a class="pluginMiniBoxDesc" title="{if !empty($author)}{'By %s'|@translate|@sprintf:$author} | {/if}{'Version'|@translate} {$version}<br/>{$plugin.DESC|@escape:'html'}"></a>
     192      </div>
     193      <div class="pluginActions">
     194        <div>
     195        {if $plugin.STATE == 'active'}
    55196          <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
    56197          | <a href="{$plugin.U_ACTION}&amp;action=restore" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
    57198
    58     {elseif $plugin_state == 'inactive'}
     199        {elseif $plugin.STATE == 'inactive'}
    59200          <a href="{$plugin.U_ACTION}&amp;action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>
    60           | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
    61 
    62     {elseif $plugin_state == 'missing'}
    63           <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
    64 
    65     {elseif $plugin_state == 'merged'}
    66           <a href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
    67     {/if}
    68         </td>
    69         <td>
    70           {'Version'|@translate} {$plugin.VERSION}
    71     {if not empty($plugin.AUTHOR)}
    72       {if not empty($plugin.AUTHOR_URL)}
    73         {assign var='author' value='<a href="%s">%s</a>'|@sprintf:$plugin.AUTHOR_URL:$plugin.AUTHOR}
    74       {else}
    75         {assign var='author' value=$plugin.AUTHOR}
    76       {/if}
    77           | {'By %s'|@translate|@sprintf:$author}
    78     {/if}
    79 
    80     {if not empty($plugin.VISIT_URL)}
    81           | <a class="externalLink" href="{$plugin.VISIT_URL}">{'Visit plugin site'|@translate}</a>
    82     {/if}
    83         </td>
    84       </tr>
    85     </table>
    86   </div>
    87     {/if}
    88   {/foreach}
    89 </fieldset>
     201          | <a href="{$plugin.U_ACTION}&amp;action=delete"  class="plugin-delete"onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
     202
     203        {elseif $plugin.STATE == 'missing'}
     204          <a href="{$plugin.U_ACTION}&amp;action=uninstall" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
     205
     206        {elseif $plugin.STATE == 'merged'}
     207          <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete">{'Delete'|@translate}</a>
     208        {/if}
     209        </div>
     210      </div>
     211    </div> {*<!-- pluginMiniBox -->*}
     212   
     213  {/if}
     214 
    90215{/foreach}
     216  </fieldset>
    91217
    92218{/if}
  • trunk/admin/themes/default/theme.css

    r10113 r10305  
    928928.comment A:hover {border:none;}
    929929
     930.pluginBoxes {text-align:left;}
     931.author-group {text-align:left;background:url('icon/remove_filter.png') left center no-repeat;padding-left:15px;margin-left:-15px;}
     932
    930933.pluginBox {margin-bottom:10px;-moz-border-radius:5px;}
    931 .pluginBox table {width:99%}
     934.pluginBox table {width:99%;}
    932935.pluginBox td {text-align:left;}
    933 .pluginBox td.pluginDesc {cursor:pointer;}
    934 .pluginBox td.pluginDesc img{vertical-align:middle;}
    935 .pluginBox td em{float:right;}
    936 .pluginBoxNameCell {width:150px; vertical-align:top;}
     936.pluginBox td.pluginDesc img {vertical-align:middle;}
     937.pluginBoxNameCell {width:180px; vertical-align:top;}
     938.pluginBox.inactive, .pluginBox.uninstalled {margin-left:20px;opacity:0.65;filter:alpha(opacity=65);}
     939.pluginsByState .pluginBox.inactive, .pluginsByState .pluginBox.uninstalled {margin-left:0px;opacity:0.8;filter:alpha(opacity=80);}
     940
     941.pluginMiniBox {display:inline-table; text-align:center; width:250px; height:40px; margin:5px; -moz-border-radius:5px; overflow:hidden; }
     942.pluginMiniBoxNameCell {font-size:1.05em; margin:5px 0;}
     943.pluginActions {display: table-row; font-size:12px; }
     944.pluginActions DIV {display: table-cell; vertical-align: middle; line-height:18px; }
     945.pluginMiniBox.inactive, .pluginMiniBox.uninstalled {opacity:0.65;filter:alpha(opacity=65);}
     946.pluginsByState .pluginMiniBox.inactive, .pluginsByState .pluginMiniBox.uninstalled {opacity:0.8;filter:alpha(opacity=80);}
     947
     948.pluginMiniBoxDesc{float:right;margin:0 4px 0 -20px;}
     949.pluginMiniBoxDesc:after{content:url(icon/help-min.png);}
     950.warning:before {content:url(icon/warning.png);vertical-align:top;}
     951fieldset.pluginsByName{border:none;}
    937952
    938953.languageBoxes {min-height:0;text-align:left;}
     
    10441059#batchManagerGlobal #applyFilterBlock {margin-top:20px;}
    10451060#batchManagerGlobal .useFilterCheckbox {display:none}
    1046 
    1047 .warning {
    1048   background:url(icon/warning.png) no-repeat top left;
    1049   width: 130px;
    1050   padding-left: 20px;
    1051 }
  • trunk/admin/themes/roma/theme.css

    r9815 r10305  
    235235#footer {background-image: url(images/piwigo_logo_small.png);}
    236236
    237 .pluginBox {background-color:#333;color:#999}
    238 .pluginBoxNameCell {color:#ccc;}
     237.pluginBox, .pluginMiniBox {background-color:#333;color:#999;border:1px solid #333;}
     238.pluginBoxNameCell, .pluginMiniBoxNameCell {color:#ddd;}
     239.pluginBox.active, .pluginMiniBox.active {border-color:#666;background-color:#383838;}
     240.pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#800 !important;}
     241.pluginBox.missing, .pluginBox.merged, .pluginMiniBox.missing, .pluginMiniBox.merged {background-color:#422;border:1px solid #800;}
     242.plugin-delete {color:#f00;}
    239243
    240244.languageBox {background-color:#333;}
  • trunk/language/en_UK/admin.lang.php

    r10248 r10305  
    186186$lang['Comments for all'] = "Comments for all";
    187187$lang['Comments'] = "Comments";
     188$lang['Compact'] = "Compact";
     189$lang['Complete'] = "Complete";
    188190$lang['Complementary mail content'] = "Complementary mail content";
    189191$lang['Complementary mail content'] = "Complementary mail content";
     
    570572$lang['Represents'] = "Represents";
    571573$lang['Resize'] = 'Resize';
     574$lang['Restore'] = "Restore";
    572575$lang['Results of miniaturization'] = "Miniaturization process results";
    573576$lang['Save order'] = "Save order";
  • trunk/language/fr_FR/admin.lang.php

    r10250 r10305  
    795795$lang['ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'] = 'ERREUR: CE PLUGIN EST MANQUANT MAIS TOUJOURS INSTALLÉ! DÉSINSTALLEZ-LE.';
    796796$lang['display'] = 'Afficher';
     797$lang['Compact'] = "Compact";
     798$lang['Complete'] = "Complet";
     799$lang['Restore'] = "Restaurer";
    797800?>
  • trunk/themes/default/js/plugins/jquery.tipTip.minified.js

    r5098 r10305  
    55 * code.drewwilson.com/entry/tiptip-jquery-plugin
    66 *
    7  * Version 1.2   -   Updated: Jan. 13, 2010
     7 * Version 1.3   -   Updated: Mar. 23, 2010
    88 *
    99 * This Plug-In will create a custom tooltip to replace the default
     
    1919 *   http://www.gnu.org/licenses/gpl.html
    2020 */
    21 (function($){$.fn.tipTip=function(options){var defaults={maxWidth:"200px",edgeOffset:3,delay:400,fadeIn:200,fadeOut:200,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");}
    22 return this.each(function(){var org_elem=$(this);var org_title=org_elem.attr("title");if(org_title!=""){org_elem.removeAttr("title");var timeout=false;org_elem.hover(function(){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(w_compare<0){if((w_compare+left)<parseInt($(window).scrollLeft())){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((tip_w+left)>parseInt($(window).width())){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);}}
    23 if((top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop())){t_class=t_class+"_top";arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset));}else if(((top+org_height)-(opts.edgeOffset+tip_h))<0||t_class==""){t_class=t_class+"_bottom";arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset);}
    24 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;}
    25 if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5;}
    26 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);}
    27 timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn);},opts.delay);},function(){opts.exit.call(this);if(timeout){clearTimeout(timeout);}tiptip_holder.fadeOut(opts.fadeOut);});}});}})(jQuery);
     21(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);
Note: See TracChangeset for help on using the changeset viewer.