Ignore:
Timestamp:
2010/03/11 10:35:11 (14 years ago)
Author:
kajiwara
Message:

正式版にナイトリービルド版をマージしてみるテスト

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tmp/version-2_5-test/html/user_data/packages/default/js/site.js

    r18562 r18609  
    3636// 郵便番号入力呼び出し. 
    3737function fnCallAddress(php_url, tagname1, tagname2, input1, input2) { 
    38     zip1 = document.form1[tagname1].value; 
    39     zip2 = document.form1[tagname2].value; 
    40      
    41     if(zip1.length == 3 && zip2.length == 4) { 
    42         url = php_url + "?zip1=" + zip1 + "&zip2=" + zip2 + "&input1=" + input1 + "&input2=" + input2; 
    43         window.open(url,"nomenu","width=500,height=350,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 
    44     } else { 
    45         alert("郵便番号を正しく入力して下さい。"); 
     38    zip1 = document.form1[tagname1].value; 
     39    zip2 = document.form1[tagname2].value; 
     40 
     41    if(zip1.length == 3 && zip2.length == 4) { 
     42        $.get( 
     43            php_url, 
     44            {zip1: zip1, zip2: zip2, input1: input1, input2: input2}, 
     45            function(data) { 
     46                arrdata = data.split("|"); 
     47                if (arrdata.length > 1) { 
     48                    fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]); 
     49                } else { 
     50                    alert(data); 
     51                } 
     52            } 
     53        ); 
     54    } else { 
     55        alert("郵便番号を正しく入力して下さい。"); 
    4656    } 
    4757} 
    4858 
    4959// 郵便番号から検索した住所を渡す. 
    50 function fnPutAddress(input1, input2) { 
    51     // 親ウィンドウの存在確認。. 
    52     if(fnIsopener()) { 
    53         if(document.form1['state'].value != "") { 
    54             // 項目に値を入力する. 
    55             state_id = document.form1['state'].value; 
    56             town = document.form1['city'].value + document.form1['town'].value; 
    57             window.opener.document.form1[input1].selectedIndex = state_id; 
    58             window.opener.document.form1[input2].value = town; 
    59         } 
    60     } else { 
    61         window.close(); 
    62     }        
     60function fnPutAddress(input1, input2, state, city, town) { 
     61    if(state != "") { 
     62        // 項目に値を入力する. 
     63        document.form1[input1].selectedIndex = state; 
     64        document.form1[input2].value = city + town; 
     65    } 
    6366} 
    6467 
     
    7982// セレクトボックスに項目を割り当てる. 
    8083function fnSetSelect(name1, name2, val) { 
    81     sele1 = document.form1[name1];  
     84    sele1 = document.form1[name1]; 
    8285    sele2 = document.form1[name2]; 
    83      
     86 
    8487    if(sele1 && sele2) { 
    8588        index=sele1.selectedIndex; 
    86          
    87         // セレクトボックスのクリア  
     89 
     90        // セレクトボックスのクリア 
    8891        count=sele2.options.length 
    8992        for(i = count; i >= 0; i--) { 
    9093            sele2.options[i]=null; 
    9194        } 
    92          
     95 
    9396        // セレクトボックスに値を割り当てる。 
    9497        len = lists[index].length 
     
    127130        } 
    128131        break; 
    129     case 'delete_order': 
    130         if(!window.confirm('在庫数は手動で戻してください。\n一度削除したデータは、元に戻せません。\n削除しても宜しいですか?')){ 
    131             return; 
    132         } 
    133         break; 
    134132    case 'confirm': 
    135133        if(!window.confirm('登録しても宜しいですか')){ 
     
    168166            return; 
    169167        } 
    170         break;       
     168        break; 
    171169    default: 
    172170        break; 
     
    185183} 
    186184 
     185function fnSetVal(key, val) { 
     186    fnSetFormVal('form1', key, val); 
     187} 
     188 
    187189function fnSetFormVal(form, key, val) { 
    188190    document.forms[form][key].value = val; 
     
    205207    } 
    206208 
    207     function fnSubmit(){ 
     209function fnSubmit(){ 
    208210    document.form1.submit(); 
    209211} 
     
    215217                        'use_point' 
    216218                        ); 
    217      
     219 
    218220        if(!document.form1['point_check'][0].checked) { 
    219221            color = "#dddddd"; 
     
    223225            flag = false; 
    224226        } 
    225          
     227 
    226228        len = list.length 
    227229        for(i = 0; i < len; i++) { 
     
    254256                        'deliv_tel03' 
    255257                        ); 
    256      
     258 
    257259        if(!document.form1['deliv_check'].checked) { 
    258260            fnChangeDisabled(list, '#dddddd'); 
     
    263265} 
    264266 
    265  
    266 // 購入時会員登録入力制限。 
    267 function fnCheckInputMember() { 
    268     if(document.form1['member_check']) { 
    269         list = new Array( 
    270                         'password', 
    271                         'password_confirm', 
    272                         'reminder', 
    273                         'reminder_answer' 
    274                         ); 
    275  
    276         if(!document.form1['member_check'].checked) { 
    277             fnChangeDisabled(list, '#dddddd'); 
    278         } else { 
    279             fnChangeDisabled(list, ''); 
    280         } 
    281     } 
    282 } 
    283  
    284267// 最初に設定されていた色を保存しておく。 
    285268var g_savecolor = new Array(); 
     
    287270function fnChangeDisabled(list, color) { 
    288271    len = list.length; 
    289      
     272 
    290273    for(i = 0; i < len; i++) { 
    291274        if(document.form1[list[i]]) { 
     
    298281                document.form1[list[i]].disabled = true; 
    299282                g_savecolor[list[i]] = document.form1[list[i]].style.backgroundColor; 
    300                 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0";   
    301             }            
     283                document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 
     284            } 
    302285        } 
    303286    } 
     
    308291function fnCheckLogin(formname) { 
    309292    var lstitem = new Array(); 
    310      
     293 
    311294    if(formname == 'login_mypage'){ 
    312295    lstitem[0] = 'mypage_login_email'; 
     
    319302    var errflg = false; 
    320303    var cnt = 0; 
    321      
     304 
    322305    // 必須項目のチェック 
    323306    for(cnt = 0; cnt < max; cnt++) { 
     
    327310        } 
    328311    } 
    329      
    330     // 必須項目が入力されていない場合   
     312 
     313    // 必須項目が入力されていない場合 
    331314    if(errflg == true) { 
    332315        alert('メールアドレス/パスワードを入力して下さい。'); 
     
    334317    } 
    335318} 
    336      
     319 
    337320// 時間の計測. 
    338321function fnPassTime(){ 
     
    350333    } else { 
    351334        window.close(); 
    352     }        
     335    } 
    353336} 
    354337 
     
    372355// テキストエリアのサイズを変更する. 
    373356function ChangeSize(button, TextArea, Max, Min, row_tmp){ 
    374      
     357 
    375358    if(TextArea.rows <= Min){ 
    376359        TextArea.rows=Max; button.value="小さくする"; row_tmp.value=Max; 
     
    380363} 
    381364 
     365// お届け時間のリアル反映 
     366function fnSetDelivTime(mode, r_key, s_id) { 
     367    var f_key, f_val; 
     368    var f_cnt = document.form1.length; 
     369    var f_data = "mode=" + mode; 
     370 
     371    // formデータの形成 
     372    for (i = 0; i < f_cnt; i++) { 
     373        f_key = document.form1[i].name; 
     374        f_val = document.form1[i].value; 
     375        if (f_key != "mode") { 
     376            if (f_key == r_key) { 
     377                if (document.form1[i].checked === true) { 
     378                    f_data += "&" + f_key + "=" + f_val; 
     379                } 
     380            } else { 
     381                f_data += "&" + f_key + "=" + f_val; 
     382            } 
     383        } 
     384    } 
     385 
     386    // AJAX 
     387    $.ajax({ 
     388        type: "POST", 
     389        url: document.form1.action, 
     390        data: f_data, 
     391        dataType: "json", 
     392        success: function(data) { 
     393            var elm_s = "select#" + s_id; 
     394            var elm_o = elm_s + " option"; 
     395            $(elm_o).remove(); 
     396            $(elm_s).append($('<option>').attr({value: ""}).text("指定なし")); 
     397            for (i = 0; i < data.length; i++) { 
     398                if (data[i].time_id > 0) { 
     399                    $(elm_s).append($('<option>').attr({value: data[i].time_id}).text(data[i].deliv_time)); 
     400                    $(elm_s).width(); 
     401                } 
     402            } 
     403        } 
     404    }); 
     405} 
Note: See TracChangeset for help on using the changeset viewer.