V: { // Variables
},
+ /**
+ * list of callbacks, categorized into _callbacks['event_name'] = [ callback_function_1, callback_function_2 ]
+ *
+ * @access private
+ */
+ _callbacks: {},
+
/**
* Map of localized message strings exported to script from the PHP
* side via Action::getScriptMessages().
.text(text)
);
},
+
+ addCallback: function (ename, callback) {
+ // initialize to array if it's undefined
+ if (typeof SN._callbacks[ename] === 'undefined') {
+ SN._callbacks[ename] = [];
+ }
+ SN._callbacks[ename].push(callback);
+ },
+
+ runCallbacks: function (ename, data) {
+ if (typeof SN._callbacks[ename] === 'undefined') {
+ return;
+ }
+ for (cbname in SN._callbacks[ename]) {
+ SN._callbacks[ename][cbname](data);
+ }
+ }
},
E: { /* Events */
form.find('[name=inreplyto]').val('');
form.find('.attach-status').remove();
SN.U.FormNoticeEnhancements(form);
+
+ SN.U.runCallbacks('notice_posted', {"notice": notice});
},
},