Ticket #1553: link.diff

File link.diff, 3.4 KB (added by guest, 9 years ago)

fixed case issues in original patch (createlink vs createLink)

  • XinhaCore.js

    diff --git a/XinhaCore.js b/XinhaCore.js
    index e5a2b26..e9dd9e9 100644
    a b Xinha.Config = function() 
    11561156    selectall: [ "Select all", ["ed_buttons_main.png",3,5], false, function(e) {e.execCommand("selectall");} ], 
    11571157 
    11581158    inserthorizontalrule: [ "Horizontal Rule", ["ed_buttons_main.png",6,0], false, function(e) { e.execCommand("inserthorizontalrule"); } ], 
    1159     createlink: [ "Insert Web Link", ["ed_buttons_main.png",6,1], false, function(e) { e._createLink(); } ], 
     1159    createlink: [ "Insert Web Link", ["ed_buttons_main.png",6,1], false, function(e) { e.execCommand("createlink"); } ], 
    11601160    insertimage: [ "Insert/Modify Image", ["ed_buttons_main.png",6,3], false, function(e) { e.execCommand("insertimage"); } ], 
    11611161    inserttable: [ "Insert Table", ["ed_buttons_main.png",6,2], false, function(e) { e.execCommand("inserttable"); } ], 
    11621162 
    Xinha.Config = function() 
    11851185    
    11861186  this.dblclickList =  
    11871187  { 
    1188     "a": [function(e, target) {e._createLink(target);}], 
     1188      "a": [function(e, target) {e.execCommand("createlink", false, target);}], 
    11891189    "img": [function(e, target) {e._insertImage(target);}] 
    11901190  }; 
    11911191 
  • modules/CreateLink/link.js

    diff --git a/modules/CreateLink/link.js b/modules/CreateLink/link.js
    index 08e989a..1c826ce 100644
    a b function CreateLink(editor) { 
    2828        var cfg = editor.config; 
    2929        var self = this; 
    3030 
    31    editor.config.btnList.createlink[3] = function() { self.show(self._getSelectedAnchor()); } 
     31        if(typeof editor._createLink == 'undefined') { 
     32            editor._createLink = function(target) { 
     33                if(!target) target = self._getSelectedAnchor(); 
     34                self.show(target); 
     35            } 
     36        } 
    3237} 
    3338 
    3439CreateLink._pluginInfo = { 
  • plugins/DoubleClick/DoubleClick.js

    diff --git a/plugins/DoubleClick/DoubleClick.js b/plugins/DoubleClick/DoubleClick.js
    index 0b75af4..8db76fe 100644
    a b function DoubleClick(editor) { 
    3737  //              - target is the selected object 
    3838  this.editor.dblClickList = { 
    3939    // Edit Link dialog 
    40     a: [ function(e) {e.config.btnList['createlink'][3](e); } ], 
     40    a: [ function(e, target) {e.execCommand("createlink", false, target);} ], 
    4141    // Follow link 
    4242    //a: [ function(editor, target) { window.location = target.href; properties(target); } ], 
    4343 
  • plugins/Linker/Linker.js

    diff --git a/plugins/Linker/Linker.js b/plugins/Linker/Linker.js
    index f1d88b7..c63e3a4 100644
    a b function Linker(editor, args) 
    3131  this.lConfig = editor.config.Linker; 
    3232 
    3333  var linker = this; 
    34   if(editor.config.btnList.createlink) 
    35   { 
    36     editor.config.btnList.createlink[3] 
    37       =  function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); }; 
     34  if(typeof editor._createLink == 'undefined') { 
     35      editor._createLink = function(target) { 
     36          if(!target) target = linker._getSelectedAnchor(); 
     37          linker._createLink(target); 
     38      } 
    3839  } 
    39   else 
     40  if(!editor.config.btnList.createlink) 
    4041  { 
    4142    editor.config.registerButton( 
    4243                                 'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false, 
    43                                  function(e, objname, obj) { linker._createLink(linker._getSelectedAnchor()); } 
     44                                 function(e, objname, obj) { editor.execCommand("createlink"); } 
    4445                                 ); 
    4546  } 
    4647