kai-jacobsen/kontentblocks

View on GitHub
js/src/common/Notice.js

Summary

Maintainability
A
1 hr
Test Coverage
'use strict';
//KB.Notice
module.exports =
{
  notice: function (msg, type, delay) {
    var timeout = delay || 3;
    window.alertify.notify(msg, type, timeout);
  },
  confirm: function (title, msg, yes, no, scope) {
    var t = title || 'Title';
    window.alertify.confirm(t, msg, function () {
      yes.call(scope);
    }, function () {
      no.call(scope);
    });
  },
  prompt: function (title, msg, value, yes, no, scope) {
    var t = title || 'Title';
    window.alertify.prompt(t, msg, value, function (evt,value) {
      yes.call(scope, evt,value);
    }, function (evt,value) {
      no.call(scope,evt,value);
    });
  }
};