source: trunk/admin/inc/FCKeditor/editor/_source/classes/fckevents.js@ 2

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 1.3 KB
Line 
1/*
2 * FCKeditor - The text editor for internet
3 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
4 *
5 * Licensed under the terms of the GNU Lesser General Public License:
6 * http://www.opensource.org/licenses/lgpl-license.php
7 *
8 * For further information visit:
9 * http://www.fckeditor.net/
10 *
11 * "Support Open Source software. What about a donation today?"
12 *
13 * File Name: fckevents.js
14 * FCKEvents Class: used to handle events is a advanced way.
15 *
16 * File Authors:
17 * Frederico Caldeira Knabben (fredck@fckeditor.net)
18 */
19
20var FCKEvents ;
21
22FCKEvents = function( eventsOwner )
23{
24 this.Owner = eventsOwner ;
25 this.RegisteredEvents = new Object() ;
26}
27
28FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
29{
30 var aTargets ;
31
32 if ( !( aTargets = this.RegisteredEvents[ eventName ] ) )
33 this.RegisteredEvents[ eventName ] = [ functionPointer ] ;
34 else
35 aTargets.push( functionPointer ) ;
36}
37
38FCKEvents.prototype.FireEvent = function( eventName, params )
39{
40 var bReturnValue = true ;
41
42 var oCalls = this.RegisteredEvents[ eventName ] ;
43
44 if ( oCalls )
45 {
46 for ( var i = 0 ; i < oCalls.length ; i++ )
47 bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ;
48 }
49
50 return bReturnValue ;
51}
Note: See TracBrowser for help on using the repository browser.