BSP 공통 스크립트

– 파일 다운로드

function download_file(name){

  window.location=name;

}

– 문자열 앞뒤 공백제거

input = input.replace(/(^\s*)|(\s*$)/, ”);

  SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000; background: #FFFFFF; } .L3S32 { color: #7D9EC0; } .L3S33 { color: #009300; } .L3S50 { color: #00008B; } .L3S51 { color: #8B0000; } .L3S54 { font-weight: bold; color: #FFAD5B; } <%@page language=”abap” %>

<SCRIPT LANGUAGE=”JavaScript”>

    /***********************************

    *  확인 창 Alert

    *  1: 저장, 2:취소, 3:삭제, 4:수정, 5:이전화면 6:닫기  7: 활성화   8: 비활성화 9: COPY

     ***********************************/

    function BspButtonConfirm(alertno, htmlbevent)

    {

        var Check = false;

        switch (alertno) {

            case 1: Check = confirm(‘<%=otr(ZAVOTR/MSG_SAVE)%>’);     break;

            case 2: Check = confirm(‘<%=otr(ZAVOTR/MSG_CANCLE)%>’);   break;

            case 3: Check = confirm(‘<%=otr(ZAVOTR/MSG_DELETE)%>’);   break;

            case 4: Check = confirm(‘<%=otr(ZAVOTR/MSG_UPDATE)%>’);   break;

            case 5: Check = confirm(‘<%=otr(ZAVOTR/MSG_BACK)%>’);     break;

            case 6: Check = confirm(‘<%=otr(ZAVOTR/MSG_WINCLOSE)%>’); break;

            case 7: Check = confirm(‘<%=otr(ZAVOTR/MSG_ACTIVATE)%>’); break;

            case 8: Check = confirm(‘<%=otr(ZAVOTR/MSG_INACTIVATE)%>’); break;

            case 9: Check = confirm(‘<%=otr(ZAVOTR/MSG_COPY)%>’); break;

        }

        if(Check == false) {

            htmlbevent.cancelSubmit = true;

        } else {

            htmlbevent.cancelSubmit = false;

            if(alertno == “6”){

                self.close();

            }

        }

    }

     /***********************************

     *  팝업창 간단하게 띄우기.

     *  새로운창을 화면 가운데에 띄운다.

     *  url : 해당 URL    String

     *  name  : 해당 Window명      String

     *  width : 새창 너비   int

     *  height  : 새창 높이   int

     *  scroll  : 새창 scroll yes/no

     *  resize  : 새창 resize yes/no

     ***********************************/

    function newWindow(url, name, width, height)

    {

        var win= null;

        var winl = (screen.width-width)/2;

        var wint = (screen.height-height)/2;

        var settings  =’height=’+height+’,’;

            settings +=’width=’+width+’,’;

            settings +=’top=’+wint+’,’;

            settings +=’left=’+winl+’,’;

            settings +=’scrollbars=yes,’;

            settings +=’resizable=yes’;

        win=window.open(url,name,settings);

        if(parseInt(navigator.appVersion) >= 4){win.window.focus();}

    }

    /*****************************************

     *  숫자  콤마 찍기

     * Create Day = 2007.7.6

     * ex) <INPUT TYPE=”TEXT” VALUE=”” OnKeyPress =”javascript:num_only(event)” OnKeyUp =”javascript:this.value = addCommas(this.value)” >

     *****************************************/

    function addCommas(strValue)

    {

        strValue = strValue.replace(“,”,””).replace(“,”,””).replace(“,”,””).replace(“,”,””).replace(“,”,””)

        var objRegExp = new RegExp(‘(-?[0-9]+)([0-9]{3})’);

        while(objRegExp.test(strValue))

        {

            strValue = strValue.replace(objRegExp, ‘$1,$2’);

        }

        return strValue;

    }

    /*****************************************

     * 이메일 유효성 체크

     * Create Day = 2007.7.6

     *****************************************/

    function isEmailOK(str){

        var reg = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;

        if (str.search(reg) != -1) {

            return true;

        }

        return false;

    }

    /**  SEARCH HELP  **/

    function getSearchHelp(page, width, height  ) {

      var name = ‘SERACHHELP’

      var win= null;

      var winl = (screen.width-width)/2;

      var wint = (screen.height-height)/2;

      var settings  =’height=’+height+’,’;

          settings +=’width=’+width+’,’;

          settings +=’top=’+wint+’,’;

          settings +=’left=’+winl+’,’;

          settings +=’scrollbars=yes,’;

          settings +=’resizable=yes,’;

          settings +=’status=yes’;

      win=window.open(‘../../sap/zap_ve_co_2000/’+page,name,settings);

      if(parseInt(navigator.appVersion) >= 4){win.window.focus();}

    }

/**  NUMBER CHECK  **/

  function num_chk(num) {

      if(isNaN(num.value)) {

          alert(‘숫자만 입력하세요’);

          num.value = “”;

          num.focus();

          return;

      }

  }

</script>

<STYLE>

    .cbo_table { background-color:#dce3ec }

    .cbo_table_title  {border:1px solid white }

    .cbo_table_content  {background-color=’#FFFFFF’ }

</STYLE>

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments