How to use pnotify - 10 common examples

To help you get started, we’ve selected a few pnotify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sciactive / pnotify / libtests / browserify / src / index.js View on Github external
// Not working? Did you `npm install` first?
var PNotify = require('pnotify/dist/umd/PNotify').default;

document.getElementById('button1').addEventListener('click', function () {
  PNotify.notice({
    title: 'Yay!',
    text: 'It works!'
  });
});

document.getElementById('button2').addEventListener('click', function () {
  require('pnotify/dist/umd/PNotifyConfirm');

  PNotify.notice({
    title: 'Yay!',
    text: 'It works!',
    modules: {
      Confirm: {
github ArcadeData / arcadeanalytics / src / main / webapp / app / shared / services / notification.service.ts View on Github external
}
        if (title) {
            options['title'] = title;
        }
        options['text'] = text;

        if (timeout) {
            options['delay'] = timeout;
        }

        if (icon) {
            options['icon'] = icon;
        }

        // notification showing
        const notification = new PNotify(options);

        // console logging
        if (type === 'error') {
            console.error(title + ': ' + text);
        } else {
            console.log(title + ': ' + text);
        }

        return notification;
    }
github bluecolor / octopus / frontend / src / lib / notify.js View on Github external
import PNotify from 'pnotify'
import 'pnotify/dist/pnotify.desktop'

PNotify.prototype.options.styling = 'fontawesome'
PNotify.desktop.permission()

const success = (message) => {
  new PNotify({ // eslint-disable-line no-new
    title: 'Success',
    type: 'success',
    text: message
  })
}

const error = (message) => {
  new PNotify({ // eslint-disable-line no-new
    title: 'Error',
    type: 'error',
    text: message
  })
github voxmedia / autotune / appjs / views / application.js View on Github external
"use strict";

var $ = require('jquery'),
    _ = require('underscore'),
    Backbone = require('backbone'),
    PNotify = require('pnotify'),
    logger = require('../logger'),
    helpers = require('../helpers'),
    BaseView = require('./base_view');

// Set PNotify to use bootstrap
PNotify.prototype.options.styling = "bootstrap3";
// Load PNotify buttons component
require('pnotify/src/pnotify.buttons');

var Application = BaseView.extend(require('./mixins/links.js'), {
  className: 'container-fluid',
  template: require('../templates/application.ejs'),
  alertDefaults: {
    addclass: "stack-bottomright",
    stack: { dir1: "up", dir2: "left", firstpos1: 25, firstpos2: 25 },
    buttons: { sticker: false }
  },

  afterInit: function() {
    // Show or hide spinner on loading events
    this.listenTo(this.app, 'loadingStart', this.spinStart, this);
    this.listenTo(this.app, 'loadingStop', this.spinStop, this);
github ArcadeData / arcadeanalytics / src / main / webapp / app / shared / services / notification.service.ts View on Github external
*      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
import { Injectable } from '@angular/core';

import PNotify from 'pnotify/dist/es/PNotifyCompat';
import PNotifyButtons from 'pnotify/dist/es/PNotifyButtons';

PNotify.defaults.styling = 'brighttheme';
PNotify.defaults.icons = 'brighttheme';

@Injectable({ providedIn: 'root' })
export class NotificationService {

    private warningOptions;
    private infoOptions;
    private successOptions;
    private errorOptions;

    constructor() {

        // tslint:disable-next-line:no-unused-expression
        PNotifyButtons; // Initiate the module. Important!

        this.warningOptions = {
            type: 'warning',
github ArcadeData / arcadeanalytics / src / main / webapp / app / shared / services / notification.service.ts View on Github external
*
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
import { Injectable } from '@angular/core';

import PNotify from 'pnotify/dist/es/PNotifyCompat';
import PNotifyButtons from 'pnotify/dist/es/PNotifyButtons';

PNotify.defaults.styling = 'brighttheme';
PNotify.defaults.icons = 'brighttheme';

@Injectable({ providedIn: 'root' })
export class NotificationService {

    private warningOptions;
    private infoOptions;
    private successOptions;
    private errorOptions;

    constructor() {

        // tslint:disable-next-line:no-unused-expression
        PNotifyButtons; // Initiate the module. Important!

        this.warningOptions = {
github bluecolor / octopus / frontend / src / lib / notify.js View on Github external
import PNotify from 'pnotify'
import 'pnotify/dist/pnotify.desktop'

PNotify.prototype.options.styling = 'fontawesome'
PNotify.desktop.permission()

const success = (message) => {
  new PNotify({ // eslint-disable-line no-new
    title: 'Success',
    type: 'success',
    text: message
  })
}

const error = (message) => {
  new PNotify({ // eslint-disable-line no-new
    title: 'Error',
    type: 'error',
    text: message
  })
}
github sciactive / pnotify / libtests / webpack / src / simple-notice.js View on Github external
export default function simpleNotice() {
  return PNotify.notice({
    title: "Yay!",
    text: "It works!"
  });
}
github sciactive / pnotify / libtests / rollup / src / module-notice.js View on Github external
export default function moduleNotice () {
  return PNotify.notice({
    title: 'Yay!',
    text: 'It works!',
    modules: {
      Confirm: {
        confirm: true
      }
    }
  });
}
github sciactive / pnotify / libtests / rollup / src / simple-notice.js View on Github external
export default function simpleNotice () {
  return PNotify.notice({
    title: 'Yay!',
    text: 'It works!'
  });
}