Changeset 977 for trunk


Ignore:
Timestamp:
03/19/08 15:42:00 (11 years ago)
Author:
ray
Message:

#1155 InsertAnchor? broken in IE 7

Location:
trunk/plugins/InsertAnchor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/InsertAnchor/insert-anchor.css

    r677 r977  
    55  background-repeat: no-repeat; 
    66  background-position: left top; 
    7   padding-left: 19px; 
    87  border: 1px dotted blue; 
    98} 
  • trunk/plugins/InsertAnchor/insert-anchor.js

    r893 r977  
    33  var cfg = editor.config; 
    44  var self = this; 
    5  
     5   
     6  this.placeholderImg = '<img class="IA_placeholder" src="'+_editor_url+'plugins/InsertAnchor/img/placeholder.gif" />'; 
     7   
    68  // register the toolbar buttons provided by this plugin 
    79  cfg.registerButton({ 
     
    3537InsertAnchor.prototype.onGenerate = function() { 
    3638  this.editor.addEditorStylesheet(_editor_url + 'plugins/InsertAnchor/insert-anchor.css'); 
     39   
    3740}; 
     41 
     42InsertAnchor.prototype.inwardHtml = function(html) 
     43{ 
     44        html= html.replace(/(<a[^>]*class="anchor"[^>]*>)/g,"$1"+this.placeholderImg); 
     45        return html; 
     46} 
     47InsertAnchor.prototype.outwardHtml = function(html) 
     48{ 
     49        html= html.replace(/(<img[^>]*class="IA_placeholder"[^>]*>)/g,""); 
     50        return html; 
     51} 
    3852 
    3953InsertAnchor.prototype.buttonPress = function(editor) { 
     
    4256  var sel  = editor._getSelection(); 
    4357  var range  = editor._createRange(sel); 
     58  var self = this; 
    4459  var  a = editor._activeElement(sel); 
    4560  if(!(a != null && a.tagName.toLowerCase() == 'a')) { 
     
    7186          a.title = anchor; 
    7287          a.className = "anchor"; 
    73           a.innerHTML = html; 
     88          a.innerHTML = self.placeholderImg; 
     89                  if (html) a.innerHTML += html; 
    7490          if (Xinha.is_ie) { 
    7591            range.pasteHTML(a.outerHTML); 
Note: See TracChangeset for help on using the changeset viewer.