web/res/metadataplayer/test/hook.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Sat, 07 Jan 2012 16:15:16 +0100
changeset 468 e7f9898e6f99
parent 133 9578d3ddce17
permissions -rwxr-xr-x
Added tag V01.20 for changeset e2324dd2f7c9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     1
var Hook = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     2
  hooks: [],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     3
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     4
  register: function ( name, callback ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     5
    if( 'undefined' == typeof( Hook.hooks[name] ) )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     6
      Hook.hooks[name] = []
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     7
    Hook.hooks[name].push( callback )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     8
  },
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     9
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    10
  call: function ( name, arguments ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    11
    if( 'undefined' != typeof( Hook.hooks[name] ) )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    12
      for( i = 0; i < Hook.hooks[name].length; ++i )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    13
        if( true != Hook.hooks[name][i]( arguments ) ) { break; }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    14
  }
99
6cb4d10f0b8b NEW WEBSITE WITH : HOME / ABOUT / CLIENT.PHP
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
diff changeset
    15
}