暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editor.bootstrap.min.js 3.9KB

12345678910111213
  1. /*!
  2. Bootstrap integration for DataTables' Editor
  3. ©2015 SpryMedia Ltd - datatables.net/license
  4. */
  5. var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var f=a[d];if(b.call(c,f,d,a))return{i:d,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
  6. $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
  7. $jscomp.polyfill=function(a,b,c,e){if(b){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];d in c||(c[d]={});c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
  8. (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-editor"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net-bs")(b,c).$);c.fn.dataTable.Editor||require("datatables.net-editor")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){var d=a.fn.dataTable;d.Editor.defaults.display="bootstrap";b=d.Editor.defaults.i18n;
  9. b.create.title="<h3>"+b.create.title+"</h3>";b.edit.title="<h3>"+b.edit.title+"</h3>";b.remove.title="<h3>"+b.remove.title+"</h3>";if(b=d.TableTools)b.BUTTONS.editor_create.formButtons[0].className="btn btn-primary",b.BUTTONS.editor_edit.formButtons[0].className="btn btn-primary",b.BUTTONS.editor_remove.formButtons[0].className="btn btn-danger";a.extend(!0,a.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header"},body:{wrapper:"DTE_Body modal-body"},footer:{wrapper:"DTE_Footer modal-footer"},
  10. form:{tag:"form-horizontal",button:"btn btn-default",buttonInternal:"btn btn-default"},field:{wrapper:"DTE_Field",label:"col-lg-4 control-label",input:"col-lg-8 controls",error:"error has-error","msg-labelInfo":"help-block","msg-info":"help-block","msg-message":"help-block","msg-error":"help-block",multiValue:"well well-sm multi-value",multiInfo:"small",multiRestore:"well well-sm multi-restore"}});a.extend(!0,d.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},
  11. remove:{formButtons:{className:"btn-danger"}}});d.Editor.display.bootstrap=a.extend(!0,{},d.Editor.models.displayController,{init:function(b){var f=a('<div class="modal fade DTED"><div class="modal-dialog"><div class="modal-content"/></div></div>'),e={content:f,close:a('<button class="close">&times;</div>').on("click",function(){b.close("icon")}),modalContent:f.find("div.modal-content"),shown:!1};a(c).on("mousedown","div.modal",function(c){a(c.target).hasClass("modal")&&e.shown&&b.background()});
  12. b.on("displayOrder.dtebs",function(c,d,f,e){a.each(b.s.fields,function(b,c){a("input:not([type=checkbox]):not([type=radio]), select, textarea",c.node()).addClass("form-control")})});b._bootstrapDisplay=e;return d.Editor.display.bootstrap},open:function(b,c,d){var e=b._bootstrapDisplay;if(e.shown)d&&d();else{e.shown=!0;var f=e.modalContent;f.children().detach();f.append(c);a("div.modal-header",c).prepend(e.close);a(e.content).one("shown.bs.modal",function(){b.s.setFocus&&b.s.setFocus.focus();d&&d()}).one("hidden",
  13. function(){e.shown=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1})}},close:function(b,c){b=b._bootstrapDisplay;b.shown&&(a(b.content).one("hidden.bs.modal",function(){a(this).detach()}).modal("hide"),b.shown=!1);c&&c()},node:function(a){return a._bootstrapDisplay.content[0]}});return d.Editor});