在從UIKIT前端換到BOOSTRAP前端時,一些轉換的技巧。javascript
https://myclabs.github.io/jquery.confirm/前端
http://sciactive.github.io/pnotify/java
相關的JS:jquery
$.confirm({ text: "將發佈單" + deploy_version + "從" + org_type + "部署到" + env_type + "環境。是否確認?", confirm: function() { promiseJenkins = $.ajax({ url:'xxx', type: 'post', data:{ deploy_version: deploy_version, env_type: env_type, org_type: org_type, }, dataType: 'json', beforeSend: function(){ $(_self).attr('disabled',"true"); $(_self).append("<i class='fa fa-spinner'></i>"); }, error: function (jqXHR, textStatus, errorThrown){ new PNotify({ title: '錯誤', text: '環境流轉發生錯誤,請聯繫棱鏡開發人員', type: 'error', nonblock: { nonblock: true }, hide: false, styling: 'bootstrap3' }); }, success: function(json){ $(_self).children('i').remove(); $(_self).append("<i class='fa fa-check'></i>") window.location.reload(); new PNotify({ title: '成功', text: '環境流轉成功!', type: 'success', nonblock: { nonblock: true }, hide: false, styling: 'bootstrap3' }); } });
效果:git