Changeset 1350


Ignore:
Timestamp:
02/04/18 00:25:44 (14 months ago)
Author:
gogo
Message:

#1480 - Fix some InsertAnchor? oddities

InsertAnchor? now does not preserve the selection (wrap the anchor around it) when inserting, this is because this made dragging anchors weird. It's better to have it just insert an atomic anchor.

Also remove the background image and just use the placeholder image, this fixes problem with bad CSS getting dumped into the anchor when it's dragged.

Location:
trunk/plugins/InsertAnchor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/InsertAnchor/InsertAnchor.js

    r1315 r1350  
    44  var self = this; 
    55   
    6   this.placeholderImg = '<img class="IA_placeholder" src="'+Xinha.getPluginDir("InsertAnchor")+'/img/placeholder.gif" />'; 
     6  this.placeholderImg = '<img class="IA_placeholder" src="'+Xinha.getPluginDir("InsertAnchor")+'/img/insert-anchor.gif" />'; 
    77   
    88  // register the toolbar buttons provided by this plugin 
     
    8383                return; 
    8484  } 
     85   
    8586        var editor = this.editor; 
    8687        this.selectedHTML = editor.getSelectedHTML(); 
     
    9495  } 
    9596   
     97  this.dialog.getElementById('warning').style.display = 'none'; 
     98   
    9699  if (this.a != null && this.a.tagName.toLowerCase() == 'a') 
    97100  { 
     
    100103  else 
    101104  { 
     105    if(!this.editor.selectionEmpty(sel)) 
     106    { 
     107      this.dialog.getElementById('warning').style.display = ''; 
     108    } 
    102109    inputs = { name : '' }; 
    103110  }  
     
    136143          a.className = "anchor"; 
    137144          a.innerHTML = self.placeholderImg; 
    138                         var html = editor.getSelectedHTML(); 
    139                   if (html) a.innerHTML += html; 
     145                //      var html = editor.getSelectedHTML(); 
     146                //  if (html) a.innerHTML += html; 
    140147                        if (Xinha.is_ie)  
    141148                        { 
  • trunk/plugins/InsertAnchor/dialog.html

    r1044 r1350  
    99 
    1010</div> 
     11 
     12<div style="margin: 10px;" id="[warning]"> 
     13  <strong>Selected content may be replaced by the new anchor. Inserting an anchor is like inserting an image, you don't need to select anything.</strong> 
     14</div> 
     15 
    1116<div class="buttons"> 
    1217  <input type="button" id="[ok]"     value="_(OK)"     /> 
  • trunk/plugins/InsertAnchor/insert-anchor.css

    r977 r1350  
    22  width: 18px; 
    33  height: 18px; 
     4  /* 
    45  background-image: url(img/insert-anchor.gif); 
    56  background-repeat: no-repeat; 
    67  background-position: left top; 
    78  border: 1px dotted blue; 
     9  */ 
    810} 
Note: See TracChangeset for help on using the changeset viewer.