/**
 * Base.Message 1.0
 *
 * Requiere
 *     Base 1.0
 */
$(function() {

    $.extend(Base, {
        Message : {

            Type: {
                Success : 'success',
                Error: 'error', //alert-danger
                Info: 'info',
                Warning: 'warning',
                Exception: 'alert-danger' //alert-danger
            },

            flash: function (message, type) {

               Base.Message.custom(message, type, {});
            },

            custom: function(message, type, options){

                console.log(message);
                console.log(type);

                //Option Convert/Compatibility
                var convertOptions = {};
                if(options != undefined){
                }

                var defaultOptions = {
                  closeButton: true,
                  debug: false,
                  newestOnTop: true,
                  progressBar: false,
                  positionClass: "toastr-top-right",
                  preventDuplicates: true,
                  showDuration: 300,
                  hideDuration: 1000,
                  timeOut: 5000,
                  extendedTimeOut: 5000,
                  showEasing: "swing",
                  hideEasing: "linear",
                  showMethod: "fadeIn",
                  hideMethod: "fadeOut",
                  onclick: null,
                };

                var finallyOptions = $.extend(true, defaultOptions, options, convertOptions);

                toastr.options = finallyOptions;

                toastr[type](message);
            },

            clear: function(container){

                toastr.clear();
            },

            _qxMessage : function (message) {

                return {

                    ver : function () {

                        console.log("Base.Message 1.0");
                        console.log("Requiere: Base 1.0");
                    }
                }
            }
        }
    });

    $.fn.QxMessage = function () {

        var message = this;

        return Base.Modal._qxMessage(message);
    }
});