summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 14:19:52 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 14:19:52 +0000
commit3b38e067fd89ff95492c1951854f1754d668dfdc (patch)
tree7f7cc44fd6c154f2cac3b63ca69b7cf6b07d7459
parent9b04db8503c2cf4501bf88d588e2b901916c7490 (diff)
downloadPost-SMTP-3b38e067fd89ff95492c1951854f1754d668dfdc.zip
add new js file
-rw-r--r--script/post-smtp-hooks.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/script/post-smtp-hooks.js b/script/post-smtp-hooks.js
new file mode 100644
index 0000000..092f024
--- /dev/null
+++ b/script/post-smtp-hooks.js
@@ -0,0 +1,15 @@
+var Hook = {
+ hooks: [],
+
+ register: function ( name, callback ) {
+ if( 'undefined' == typeof( Hook.hooks[name] ) )
+ Hook.hooks[name] = []
+ Hook.hooks[name].push( callback )
+ },
+
+ call: function ( name, arguments ) {
+ if( 'undefined' != typeof( Hook.hooks[name] ) )
+ for( i = 0; i < Hook.hooks[name].length; ++i )
+ if( true != Hook.hooks[name][i]( arguments ) ) { break; }
+ }
+} \ No newline at end of file