2020-05-13

[AgentFlow]套用Bootstrap框架

AF套用Bootstrap,找時間研究一下
Bootstrap 檔案位置 /WebAgenda/ext/css/bootstrap.min.css
——-放HTML共用函式————-
function switchPanel(targetId, idArray) {
 var targetEl = jQuery('#' + targetId);
 var objHeight = targetEl.height();
 var moveToTop = 300;
 var currentHeight = objHeight + moveToTop + 400;
 
 targetEl.show();
 
 jQuery.each( idArray, function( index, value ) {
  if ( value != targetId ) jQuery('#' + value ).hide();
 
 })
 targetEl.css('top', moveToTop);
 targetEl.css('visibility', 'visible');
 jQuery('#ITEM1').animate({'height':currentHeight}, 'fast');
 jQuery(parent.document.getElementById('artifact')).animate({'height':currentHeight}, 'fast');

 //reFixTableHeader
 jQuery('iframe[src*=”table”]').each(function() {
      this.contentWindow.reFixTableHeader()
    }
  )
}

//btnPanel 換顏色
function swicthPanelBtnColor(btnID, btnArray){
    document.getElementById(btnID).classList.add("btnPanel", "btnPanel_navyBlue");
    
    for(var i = 0; i< btnArray.length; i++){
      document.getElementById(btnArray[i]).classList.remove("btnPanel_navyBlue");
    }
}
——-放HTML共用函式————-

——-放表單HTML事件onLoad————
var link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = '/WebAgenda/ext/css/bootstrap.min.css';
document.getElementsByTagName("head")[0].appendChild(link);
document.getElementsByTagName("body")[0].appendChild(link);

var link2 = document.createElement('link');
link2.type = 'text/css';
link2.rel = 'stylesheet';
link2.href = '/WebAgenda/ext/css/reset.css';
document.getElementsByTagName("head")[0].appendChild(link2);
document.getElementsByTagName("body")[0].appendChild(link2);

var link3 = document.createElement('link');
link3.type = 'text/css';
link3.rel = 'stylesheet';
link3.href = '/WebAgenda/ext/css/form-page.css';
document.getElementsByTagName("head")[0].appendChild(link3);
document.getElementsByTagName("body")[0].appendChild(link3);

//設定button_green
var btn_greenArr = [‘ITEM8’];
var classArray = [“btn”, “btn-info”];
addClass(btn_greenArr, classArray);

//設定button_org
var btn_orange = [‘ITEM17’];
var classArray = [“btn”, “btn-org”];
addClass(btn_orange, classArray);

//設定button_gray
var btn_gray = [‘ITEM18’];
var classArray = [“btn”, “btn-gray”];
addClass(btn_gray, classArray);

 

//設定textField
var txt_Arr = [‘ITEM19′,’ITEM3′,’ITEM6’,];
var classArray = [“form-control”];
addClass(txt_Arr, classArray);

//設定comboBox
var cboArray = [‘ITEM21’, ‘ITEM54’, ‘ITEM55’];
var classArray = [“form-control”, “form-control-w”];
addClass(cboArray, classArray);

//設定panel
//var panelArray = [‘ITEM82’, ‘ITEM83’, ‘ITEM84’, ‘ITEM398’, ‘ITEM431’, ‘ITEM442’];
//var classArray = [“btnPanel”, “btnPanel_blue”];
//addClass(panelArray, classArray);

////設定comboBox
//var cboArray = [‘ITEM21’, ‘ITEM44’, ‘ITEM125’, ‘ITEM110’, ‘ITEM111’, ‘ITEM113’, ‘ITEM114’, ‘ITEM117’, ‘ITEM118’, ‘ITEM124’];
//var classArray = [“form-control”, “form-control-w”];
//addClass(cboArray, classArray);
//
////設定button_green
//var btn_greenArr = [‘ITEM8’, ‘ITEM131’, ‘ITEM132’];
//var classArray = [“btn”, “btn-green”];
//addClass(btn_greenArr, classArray);
//
////設定button_org
//var btn_orange = [‘ITEM127’];
//var classArray = [“btn”, “btn-org”];
//addClass(btn_orange, classArray);
//
////設定button_gray
//var btn_gray = [‘ITEM129’, ‘ITEM130’, ‘ITEM134’];
//var classArray = [“btn”, “btn-gray”];
//addClass(btn_gray, classArray);
//
////設定textField
//var txt_Arr = [‘ITEM3’];
//var classArray = [“form-control”];
//addClass(txt_Arr, classArray);
//
////設定textArea
//var txtArea_Arr = [‘ITEM71’];
//var classArray = [“form-control-Area”];
//addClass(txtArea_Arr, classArray);


function addClass(objArray, clsArray){
    for(var i = 0; i

沒有留言:

張貼留言