; (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // Node, CommonJS之类的 module.exports = factory(require('jquery')); } else { // 浏览器全局变量(root 即 window) root.AmpDialog = factory(root.jQuery); } } (this, function ($) { var AmpDialog = function (options) { var DEFAULT = { title: '', type: 'dialog', //TODO:alter | confirm | dialog mask: true, width: 500, height: undefined, theme: '', //样式 //远程加载文档, 参考jQuery.load // remote: { // url:'', //url // params: {}, //params // callback: function(){} //callback // } // remote 和content 不能同时存在 remote: null, content: '', onConfirm: function () { //this instanceof AmpDialog // 点击确定时的callback }, onCancel: function () { //this instanceof AmpDialog //点击取消和关闭时的 callback }, template: [ '