Changeset 23066 for branches/version-2_13-dev/html/js/eccube.js
- Timestamp:
- 2013/08/15 08:54:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/html/js/eccube.js
r23065 r23066 23 23 (function( window, undefined ){ 24 24 25 var common = {}; 26 27 common.win01 = function(URL,Winname,Wwidth,Wheight){ 25 26 // 名前空間の重複を防ぐ 27 if (window.eccube === undefined) { 28 window.eccube = {}; 29 } 30 31 var eccube = window.eccube; 32 33 eccube.win01 = function(URL,Winname,Wwidth,Wheight){ 28 34 var WIN; 29 35 WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no"); … … 31 37 }; 32 38 33 common.win02 = function(URL,Winname,Wwidth,Wheight){39 eccube.win02 = function(URL,Winname,Wwidth,Wheight){ 34 40 var WIN; 35 41 WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); … … 37 43 }; 38 44 39 common.win03 = function(URL,Winname,Wwidth,Wheight){45 eccube.win03 = function(URL,Winname,Wwidth,Wheight){ 40 46 var WIN; 41 47 WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no"); … … 43 49 }; 44 50 45 common.winSubmit = function(URL,formName,Winname,Wwidth,Wheight){51 eccube.winSubmit = function(URL,formName,Winname,Wwidth,Wheight){ 46 52 var WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no"); 47 53 document.forms[formName].target = Winname; … … 49 55 }; 50 56 51 common.openWindow = function(URL,name,width,height) {57 eccube.openWindow = function(URL,name,width,height) { 52 58 window.open(URL,name,"width="+width+",height="+height+",scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,status=no"); 53 59 }; 54 60 55 61 // 親ウィンドウの存在確認. 56 common.isOpener = function() {62 eccube.isOpener = function() { 57 63 var ua = navigator.userAgent; 58 64 if( !!window.opener ) { … … 67 73 }; 68 74 69 common.chgImg = function(fileName,img){75 eccube.chgImg = function(fileName,img){ 70 76 if (typeof(img) == "object") { 71 77 img.src = fileName; … … 75 81 }; 76 82 77 common.chgImgImageSubmit = function(fileName,imgObj){83 eccube.chgImgImageSubmit = function(fileName,imgObj){ 78 84 imgObj.src = fileName; 79 85 }; 80 86 81 87 // 郵便番号入力呼び出し. 82 common.getAddress = function(php_url, tagname1, tagname2, input1, input2) {88 eccube.getAddress = function(php_url, tagname1, tagname2, input1, input2) { 83 89 var zip1 = document.form1[tagname1].value; 84 90 var zip2 = document.form1[tagname2].value; … … 91 97 var arrData = data.split("|"); 92 98 if (arrData.length > 1) { 93 eccube. common.putAddress(input1, input2, arrData[0], arrData[1], arrData[2]);99 eccube.putAddress(input1, input2, arrData[0], arrData[1], arrData[2]); 94 100 } else { 95 101 alert(data); … … 103 109 104 110 // 郵便番号から検索した住所を渡す. 105 common.putAddress = function(input1, input2, state, city, town) {111 eccube.putAddress = function(input1, input2, state, city, town) { 106 112 if(state != "") { 107 113 // 項目に値を入力する. … … 111 117 }; 112 118 113 common.setFocus = function(name) {119 eccube.setFocus = function(name) { 114 120 if(document.form1[name]) { 115 121 document.form1[name].focus(); … … 118 124 119 125 // モードとキーを指定してSUBMITを行う。 120 common.setModeAndSubmit = function(mode, keyname, keyid) {126 eccube.setModeAndSubmit = function(mode, keyname, keyid) { 121 127 switch(mode) { 122 128 case 'delete_category': … … 150 156 }; 151 157 152 common.fnFormModeSubmit = function(form, mode, keyname, keyid) {158 eccube.fnFormModeSubmit = function(form, mode, keyname, keyid) { 153 159 switch(mode) { 154 160 case 'delete': … … 177 183 }; 178 184 179 common.setValueAndSubmit = function(form, key, val) {185 eccube.setValueAndSubmit = function(form, key, val) { 180 186 document.forms[form][key].value = val; 181 187 document.forms[form].submit(); … … 183 189 }; 184 190 185 common.setValue = function(key, val, form) {191 eccube.setValue = function(key, val, form) { 186 192 if (typeof form === 'undefined') { 187 193 form = 'form1'; … … 190 196 }; 191 197 192 common.changeAction = function(url) {198 eccube.changeAction = function(url) { 193 199 document.form1.action = url; 194 200 }; 195 201 196 202 // ページナビで使用する。 197 common.movePage = function(pageno, mode, form) {203 eccube.movePage = function(pageno, mode, form) { 198 204 if (typeof form !== 'undefined') { 199 205 form = 'form1'; … … 206 212 }; 207 213 208 common.submitForm = function(form){214 eccube.submitForm = function(form){ 209 215 if (typeof form !== 'undefined') { 210 216 form = 'form1'; 211 217 } 212 218 document.forms[form].submit(); 213 } 219 }; 214 220 215 221 // ポイント入力制限。 216 common.togglePointForm = function() {222 eccube.togglePointForm = function() { 217 223 if(document.form1['point_check']) { 218 224 var list = ['use_point']; … … 241 247 } 242 248 } 243 } 249 }; 244 250 245 251 // 別のお届け先入力制限。 246 common.toggleDeliveryForm = function() {252 eccube.toggleDeliveryForm = function() { 247 253 if(!document.form1) { 248 254 return; … … 265 271 266 272 if(!document.form1['deliv_check'].checked) { 267 eccube.c ommon.changeDisabled(list, '#dddddd');273 eccube.changeDisabled(list, '#dddddd'); 268 274 } else { 269 eccube.c ommon.changeDisabled(list, '');275 eccube.changeDisabled(list, ''); 270 276 } 271 277 } … … 273 279 274 280 // 最初に設定されていた色を保存しておく。 275 common.savedColor = [];276 277 common.changeDisabled = function(list, color) {281 eccube.savedColor = []; 282 283 eccube.changeDisabled = function(list, color) { 278 284 var len = list.length; 279 285 … … 283 289 // 有効にする。 284 290 document.form1[list[i]].disabled = false; 285 document.form1[list[i]].style.backgroundColor = eccube. common.savedColor[list[i]];291 document.form1[list[i]].style.backgroundColor = eccube.savedColor[list[i]]; 286 292 } else { 287 293 // 無効にする。 288 294 document.form1[list[i]].disabled = true; 289 eccube. common.savedColor[list[i]] = document.form1[list[i]].style.backgroundColor;295 eccube.savedColor[list[i]] = document.form1[list[i]].style.backgroundColor; 290 296 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 291 297 } … … 295 301 296 302 // ログイン時の入力チェック 297 common.checkLoginFormInputted = function(form, emailKey, passKey) {303 eccube.checkLoginFormInputted = function(form, emailKey, passKey) { 298 304 var checkItems = []; 299 305 … … 330 336 331 337 //親ウィンドウのページを変更する. 332 common.changeParentUrl = function(url) {338 eccube.changeParentUrl = function(url) { 333 339 // 親ウィンドウの存在確認 334 if(eccube. common.isOpener()) {340 if(eccube.isOpener()) { 335 341 window.opener.location.href = url; 336 342 } else { … … 343 349 //引数2:文字数カウント対象 344 350 //引数3:カウント結果格納対象 345 common.countChars = function(form,sch,cnt) {351 eccube.countChars = function(form,sch,cnt) { 346 352 document.forms[form][cnt].value= document.forms[form][sch].value.length; 347 353 }; 348 354 349 355 // テキストエリアのサイズを変更する. 350 common.toggleRows = function(buttonSelector, textAreaSelector, max, min) {356 eccube.toggleRows = function(buttonSelector, textAreaSelector, max, min) { 351 357 if ($(textAreaSelector).attr('rows') <= min) { 352 358 $(textAreaSelector).attr('rows', max); … … 361 367 * 規格2のプルダウンを設定する. 362 368 */ 363 common.setClassCategories = function($form, product_id, $sele1, $sele2, selected_id2) {369 eccube.setClassCategories = function($form, product_id, $sele1, $sele2, selected_id2) { 364 370 if ($sele1 && $sele1.length) { 365 371 var classcat_id1 = $sele1.val() ? $sele1.val() : ''; … … 389 395 $sele2.append(option); 390 396 } 391 eccube.c ommon.checkStock($form, product_id, $sele1.val() ? $sele1.val() : '__unselected2',397 eccube.checkStock($form, product_id, $sele1.val() ? $sele1.val() : '__unselected2', 392 398 $sele2.val() ? $sele2.val() : ''); 393 399 } … … 398 404 * 規格の選択状態に応じて, フィールドを設定する. 399 405 */ 400 common.checkStock = function($form, product_id, classcat_id1, classcat_id2) {406 eccube.checkStock = function($form, product_id, classcat_id1, classcat_id2) { 401 407 402 408 classcat_id2 = classcat_id2 ? classcat_id2 : ''; … … 492 498 }; 493 499 494 // 名前空間の重複を防ぐ495 if (window.eccube === undefined) {496 window.eccube = {};497 }498 500 // グローバルに使用できるようにする 499 window.eccube .common = common;501 window.eccube = eccube; 500 502 501 503 /** … … 513 515 // 規格1のみの場合 514 516 if (!$sele2.length) { 515 eccube.c ommon.checkStock($form, product_id, $sele1.val(), '0');517 eccube.checkStock($form, product_id, $sele1.val(), '0'); 516 518 // 規格2ありの場合 517 519 } else { 518 eccube. common.setClassCategories($form, product_id, $sele1, $sele2);520 eccube.setClassCategories($form, product_id, $sele1, $sele2); 519 521 } 520 522 }); … … 527 529 var $sele1 = $form.find('select[name=classcategory_id1]'); 528 530 var $sele2 = $(this); 529 eccube.c ommon.checkStock($form, product_id, $sele1.val(), $sele2.val());531 eccube.checkStock($form, product_id, $sele1.val(), $sele2.val()); 530 532 }); 531 533 });
Note: See TracChangeset
for help on using the changeset viewer.