Ticket #513: 0001-Add_Cluetip_To_message_urls.diff

File 0001-Add_Cluetip_To_message_urls.diff, 4.1 KB (added by mortonda@…, 12 years ago)
  • php/mime.php

    diff --git a/php/mime.php b/php/mime.php
    index bf2c364..ebae7f1 100644
    a b  
    170170   }
    171171
    172172
     173   class MaiaDisplayLinkURI extends HTMLPurifier_Injector
     174   {
     175
     176       public $name = 'DisplayLinkURI';
     177       public $needed = array('a');
     178
     179       private $idcount = 1;
     180
     181       public function handleElement(&$token) {
     182       }
     183
     184       public function handleEnd(&$token) {
     185           if (isset($token->start->attr['href'])){
     186               $url = $token->start->attr['href'];
     187               unset($token->start->attr['href']);
     188               $token->start->attr['class'] = 'DisplayLink';
     189               $token->start->attr['id'] = 'DisplayLink_' . $this->idcount;
     190               $token = array($token,
     191                       new HTMLPurifier_Token_Start('span', array('class' => 'DisplayLinkURL', 'id'=>'cluetip_DisplayLink_' . $this->idcount)),
     192                       new HTMLPurifier_Token_Text($url),
     193                       new HTMLPurifier_Token_End('span')
     194                       );
     195               $this->idcount += 1;
     196           } else {
     197               // nothing to display
     198           }
     199       }
     200   }
     201
     202
    173203   /*
    174204    * sanitize_html(): Do some trivial filtering of HTML contents to
    175205    *                  render it suitable for displaying in a table
     
    189219           $config->set('Cache', 'DefinitionImpl', null);
    190220       }
    191221       $config->set('URI', 'Disable', true);
     222       $config->set('Attr','EnableID', true);
     223       $config->set('AutoFormat', 'Custom', array(new MaiaDisplayLinkURI));
    192224       $purifier = new HTMLPurifier($config);
    193225
    194226       $html =  $purifier->purify($body);
  • php/themes/desert_sand/javascript/desert_sand.js

    diff --git a/php/themes/desert_sand/javascript/desert_sand.js b/php/themes/desert_sand/javascript/desert_sand.js
    index 8e8284e..60cbebb 100644
    a b  
    9797 
    9898$(document).ready(function() {
    9999
    100 $('.HelpTipAnchor').cluetip({local:true, showTitle: false,cluetipClass: 'jtip', arrows: true, localPrefix: "#cluetip_", attribute: "id"});
     100$('.HelpTipAnchor').cluetip({local:true, cluezIndex: 105, showTitle: false,cluetipClass: 'jtip', arrows: true, localPrefix: "#cluetip_", attribute: "id"});
    101101
    102102});
     103 No newline at end of file
  • php/themes/desert_sand/templates/view.tpl

    diff --git a/php/themes/desert_sand/templates/view.tpl b/php/themes/desert_sand/templates/view.tpl
    index a84fd05..a6b5d95 100644
    a b function itemAction(action, rvalue) { 
    3939</div>
    4040</form>
    4141</div>
    42 
     42<script type="text/javascript">
     43{literal}
     44$('.DisplayLink').cluetip({local:true, showTitle: false,cluetipClass: 'jtip', cluezIndex: 105, arrows: true, localPrefix: "#cluetip_", attribute: "id"});
     45{/literal}
     46</script>
    4347{else}
    4448
    4549{* Error!  Mail doesn't belong to this user! *}
  • php/themes/ocean_surf/javascript/ocean_blue.js

    diff --git a/php/themes/ocean_surf/javascript/ocean_blue.js b/php/themes/ocean_surf/javascript/ocean_blue.js
    index 1063765..37e1af1 100644
    a b  
    7575 
    7676$(document).ready(function() {
    7777
    78 $('.HelpTipAnchor').cluetip({local:true, showTitle: false,cluetipClass: 'jtip', arrows: true, localPrefix: "#cluetip_", attribute: "id"});
     78$('.HelpTipAnchor').cluetip({local:true, cluezIndex: 105, showTitle: false,cluetipClass: 'jtip', arrows: true, localPrefix: "#cluetip_", attribute: "id"});
    7979$('#messagebox div').effect("highlight", {
    8080        color: "#FFD324"
    8181    },
  • php/themes/ocean_surf/templates/view.tpl

    diff --git a/php/themes/ocean_surf/templates/view.tpl b/php/themes/ocean_surf/templates/view.tpl
    index 1a88c51..6185d6f 100644
    a b function itemAction(action, rvalue) { 
    3939</div>
    4040</form>
    4141</div>
    42 
     42<script type="text/javascript">
     43{literal}
     44$('.DisplayLink').cluetip({local:true, showTitle: false,cluetipClass: 'jtip', cluezIndex: 105, arrows: true, localPrefix: "#cluetip_", attribute: "id"});
     45{/literal}
     46</script>
    4347{else}
    4448
    4549{* Error!  Mail doesn't belong to this user! *}