- Timestamp:
- 05/10/10 04:22:00 (2 years ago)
- Files:
-
- 1 modified
-
trunk/XinhaCore.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r1248 r1256 1171 1171 killword: [ "Clear MSOffice tags", ["ed_buttons_main.png",4,3], false, function(e) { e.execCommand("killword"); } ] 1172 1172 }; 1173 1174 /** A hash of double click handlers for the given elements, each element may have one or more double click handlers 1175 * called in sequence. The element may contain a class selector ( a.somethingSpecial ) 1176 * 1177 */ 1178 1179 this.dblclickList = 1180 { 1181 "a": [function(e, target) {e._createLink(target);}], 1182 "img": [function(e, target) {e._insertImage(target);}] 1183 }; 1184 1173 1185 /** A container for additional icons that may be swapped within one button (like fullscreen) 1174 1186 * @private … … 3556 3568 } 3557 3569 ); 3570 3571 Xinha._addEvents( 3572 doc, 3573 ["dblclick"], 3574 function (event) 3575 { 3576 return editor._onDoubleClick(Xinha.is_ie ? editor._iframe.contentWindow.event : event); 3577 } 3578 ); 3579 3558 3580 if(resetting_events_for_opera) return; 3559 3581 … … 5442 5464 }; 5443 5465 5466 /** Handle double click events. 5467 * See dblclickList in the config. 5468 */ 5469 5470 Xinha.prototype._onDoubleClick = function(ev) 5471 { 5472 var editor=this; 5473 var target = Xinha.is_ie ? ev.srcElement : ev.target; 5474 var tag = target.tagName; 5475 var className = target.className; 5476 if (tag) { 5477 tag = tag.toLowerCase(); 5478 if (className && (this.config.dblclickList[tag+"."+className] != undefined)) 5479 this.config.dblclickList[tag+"."+className][0](editor, target); 5480 else if (this.config.dblclickList[tag] != undefined) 5481 this.config.dblclickList[tag][0](editor, target); 5482 }; 5483 }; 5484 5444 5485 /** Handles ctrl + key shortcuts 5445 5486 * @TODO: make this mor flexible
