Changeset 848


Ignore:
Timestamp:
06/03/07 12:50:10 (12 years ago)
Author:
gocher
Message:

change htmlarea to Xinha in plugin DoubleClick?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/DoubleClick/double-click.js

    r677 r848  
    1 // Double Click Plugin for HTMLArea-3.0 
     1// Double Click Plugin for Xinha 
    22// Implementation by Marijn Kampf http://www.marijn.org 
    33// Sponsored by http://www.smiling-faces.com 
     
    1515 
    1616DoubleClick._pluginInfo = { 
    17         name          : "DoubleClick", 
    18         version       : "1.0", 
    19         developer     : "Marijn Kampf", 
    20         developer_url : "http://www.marijn.org", 
    21         c_owner       : "Marijn Kampf", 
    22         sponsor       : "smiling-faces.com", 
    23         sponsor_url   : "http://www.smiling-faces.com", 
    24         license       : "htmlArea" 
     17  name          : "DoubleClick", 
     18  version       : "1.0", 
     19  developer     : "Marijn Kampf", 
     20  developer_url : "http://www.marijn.org", 
     21  c_owner       : "Marijn Kampf", 
     22  sponsor       : "smiling-faces.com", 
     23  sponsor_url   : "http://www.smiling-faces.com", 
     24  license       : "htmlArea" 
    2525}; 
    2626 
    2727function DoubleClick(editor) { 
    28         this.editor = editor; 
     28  this.editor = editor; 
    2929 
    30         // ADDING CUSTOM DOUBLE CLICK ACTIONS 
    31         // format of the dblClickList elements is "TAGNAME: [ ACTION ]" 
    32         //    - TAGNAME: tagname of the tag that is double clicked 
    33         //    - ACTION: function that gets called when the button is clicked. 
    34         //              it has the following prototype: 
    35         //                 function(editor, event) 
    36         //              - editor is the HTMLArea object that triggered the call 
    37         //                                                      - target is the selected object 
    38         this.editor.dblClickList = { 
    39                 // Edit Link dialog 
    40                 a: [ function(e) {e.config.btnList['createlink'][3](e); } ], 
    41                 // Follow link 
    42                 //a: [ function(editor, target) { window.location = target.href; properties(target); } ], 
     30  // ADDING CUSTOM DOUBLE CLICK ACTIONS 
     31  // format of the dblClickList elements is "TAGNAME: [ ACTION ]" 
     32  //    - TAGNAME: tagname of the tag that is double clicked 
     33  //    - ACTION: function that gets called when the button is clicked. 
     34  //              it has the following prototype: 
     35  //                 function(editor, event) 
     36  //              - editor is the Xinha object that triggered the call 
     37  //              - target is the selected object 
     38  this.editor.dblClickList = { 
     39    // Edit Link dialog 
     40    a: [ function(e) {e.config.btnList['createlink'][3](e); } ], 
     41    // Follow link 
     42    //a: [ function(editor, target) { window.location = target.href; properties(target); } ], 
    4343 
    44                 img: [ function(e) {e.execCommand("insertimage");} ], 
    45                 td: [ function(e) {e.execCommand("inserttable");} ] 
    46         }; 
     44    img: [ function(e) {e.execCommand("insertimage");} ], 
     45    td: [ function(e) {e.execCommand("inserttable");} ] 
     46  }; 
    4747} 
    4848 
    4949DoubleClick.prototype.onGenerate = function() { 
    50         var self = this; 
    51         var doc = this.editordoc = this.editor._iframe.contentWindow.document; 
    52         HTMLArea._addEvents(doc, ["dblclick"], 
    53                             function (event) { 
    54                             return self.onDoubleClick(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event); 
    55                             }); 
    56         this.currentClick = null; 
     50  var self = this; 
     51  var doc = this.editordoc = this.editor._iframe.contentWindow.document; 
     52  Xinha._addEvents(doc, ["dblclick"], 
     53          function (event) { 
     54          return self.onDoubleClick(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event); 
     55          }); 
     56  this.currentClick = null; 
    5757}; 
    5858 
    5959DoubleClick.prototype.onDoubleClick = function(ev) { 
    60         var target = HTMLArea.is_ie ? ev.srcElement : ev.target; 
    61         var tagName = target.tagName.toLowerCase(); 
     60  var target = Xinha.is_ie ? ev.srcElement : ev.target; 
     61  var tagName = target.tagName.toLowerCase(); 
    6262 
    63         if (this.editor.dblClickList[tagName] != undefined) { 
    64                 this.editor.dblClickList[tagName][0](this.editor, target); 
    65         } 
     63  if (this.editor.dblClickList[tagName] != undefined) { 
     64    this.editor.dblClickList[tagName][0](this.editor, target); 
     65  } 
    6666}; 
Note: See TracChangeset for help on using the changeset viewer.