1/* 2 * This file is part of EC-CUBE 3 * 4 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. 5 * 6 * http://www.lockon.co.jp/ 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 */ 22 23// 親ã¦ã£ã³ãã¦ã®åå¨ç¢ºèª. 24function fnIsopener() { 25 var ua = navigator.userAgent; 26 if (!!window.opener) { 27 if (ua.indexOf('MSIE 4') != -1 && ua.indexOf('Win') != -1) { 28 return !window.opener.closed; 29 } else { 30 return typeof window.opener.document == 'object'; 31 } 32 } else { 33 return false; 34 } 35} 36 37// éµä¾¿çªå·å ¥åå¼ã³åºã. 38function fnCallAddress(php_url, tagname1, tagname2, input1, input2) { 39 zip1 = document.form1[tagname1].value; 40 zip2 = document.form1[tagname2].value; 41 42 if (zip1.length == 3 && zip2.length == 4) { 43 jQuery.get( 44 php_url, 45 {zip1: zip1, zip2: zip2, input1: input1, input2: input2}, 46 function (data) { 47 arrdata = data.split("|"); 48 if (arrdata.length > 1) { 49 fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]); 50 } else { 51 alert(data); 52 } 53 } 54 ); 55 } else { 56 alert("éµä¾¿çªå·ãæ£ããå ¥åãã¦ä¸ããã"); 57 } 58} 59 60// éµä¾¿çªå·ããæ¤ç´¢ããä½æãæ¸¡ã. 61function fnPutAddress(input1, input2, state, city, town) { 62 if (state != "") { 63 // é ç®ã«å¤ãå ¥åãã. 64 document.form1[input1].selectedIndex = state; 65 document.form1[input2].value = city + town; 66 } 67} 68 69function fnOpenNoMenu(URL) { 70 window.open(URL, "nomenu", "scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 71} 72 73function fnOpenWindow(URL, name, width, height) { 74 window.open(URL, name, "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,status=no"); 75} 76 77function fnSetFocus(name) { 78 if (document.form1[name]) { 79 document.form1[name].focus(); 80 } 81} 82 83// ã»ã¬ã¯ãããã¯ã¹ã«é ç®ãå²ãå½ã¦ã. 84function fnSetSelect(name1, name2, val) { 85 sele1 = document.form1[name1]; 86 sele2 = document.form1[name2]; 87 88 if (sele1 && sele2) { 89 index = sele1.selectedIndex; 90 91 // ã»ã¬ã¯ãããã¯ã¹ã®ã¯ãªã¢ 92 count = sele2.options.length 93 for (i = count; i >= 0; i--) { 94 sele2.options[i] = null; 95 } 96 97 // ã»ã¬ã¯ãããã¯ã¹ã«å¤ãå²ãå½ã¦ãã 98 len = lists[index].length 99 for (i = 0; i < len; i++) { 100 sele2.options[i] = new Option(lists[index][i], vals[index][i]); 101 if (val != "" && vals[index][i] == val) { 102 sele2.options[i].selected = true; 103 } 104 } 105 } 106} 107 108// Enterãã¼å ¥åããã£ã³ã»ã«ããã(IEã«å¯¾å¿) 109function fnCancelEnter() { 110 if (gCssUA.indexOf("WIN") != -1 && gCssUA.indexOf("MSIE") != -1) { 111 if (window.event.keyCode == 13) { 112 return false; 113 } 114 } 115 return true; 116} 117 118// ã¢ã¼ãã¨ãã¼ãæå®ãã¦SUBMITãè¡ãã 119function fnModeSubmit(mode, keyname, keyid) { 120 switch (mode) { 121 case 'delete_category': 122 if (!window.confirm('鏿ããã«ãã´ãªã¨ã«ãã´ãªå ã®ãã¹ã¦ã®ã«ãã´ãªãåé¤ãã¾ã')) { 123 return; 124 } 125 break; 126 case 'delete': 127 if (!window.confirm('ä¸åº¦åé¤ãããã¼ã¿ã¯ãå ã«æ»ãã¾ããã\nåé¤ãã¦ãå®ããã§ããï¼')) { 128 return; 129 } 130 break; 131 case 'delete_order': 132 if (!window.confirm('ä¸åº¦åé¤ãããã¼ã¿ã¯ãå ã«æ»ãã¾ããã\nåé¤ãã¦ãå®ããã§ããï¼\n\nâ» å¨åº«æ°ã¯æåã§æ»ãã¦ãã ããã')) { 133 return; 134 } 135 mode = 'delete'; 136 break; 137 case 'confirm': 138 if (!window.confirm('ç»é²ãã¦ãå®ããã§ãã')) { 139 return; 140 } 141 break; 142 case 'delete_all': 143 if (!window.confirm('æ¤ç´¢çµæããã¹ã¦åé¤ãã¦ãå®ããã§ãã')) { 144 return; 145 } 146 break; 147 default: 148 break; 149 } 150 document.form1['mode'].value = mode; 151 if (keyname != "" && keyid != "") { 152 document.form1[keyname].value = keyid; 153 } 154 document.form1.submit(); 155} 156 157function fnFormModeSubmit(form, mode, keyname, keyid) { 158 switch (mode) { 159 case 'delete': 160 if (!window.confirm('ä¸åº¦åé¤ãããã¼ã¿ã¯ãå ã«æ»ãã¾ããã\nåé¤ãã¦ãå®ããã§ããï¼')) { 161 return; 162 } 163 break; 164 case 'confirm': 165 if (!window.confirm('ç»é²ãã¦ãå®ããã§ãã')) { 166 return; 167 } 168 break; 169 case 'regist': 170 if (!window.confirm('ç»é²ãã¦ãå®ããã§ãã')) { 171 return; 172 } 173 break; 174 default: 175 break; 176 } 177 document.forms[form]['mode'].value = mode; 178 if (keyname != "" && keyid != "") { 179 document.forms[form][keyname].value = keyid; 180 } 181 document.forms[form].submit(); 182} 183 184function fnSetFormSubmit(form, key, val) { 185 document.forms[form][key].value = val; 186 document.forms[form].submit(); 187 return false;
188} 189 190function fnSetVal(key, val) { 191 fnSetFormVal('form1', key, val); 192} 193 194function fnSetFormVal(form, key, val) { 195 document.forms[form][key].value = val; 196} 197 198function fnChangeAction(url) { 199 document.form1.action = url; 200} 201 202// ãã¼ã¸ããã§ä½¿ç¨ããã 203function fnNaviPage(pageno) { 204 document.form1['pageno'].value = pageno; 205 document.form1.submit(); 206} 207 208function fnSearchPageNavi(pageno) { 209 document.form1['pageno'].value = pageno; 210 document.form1['mode'].value = 'search'; 211 document.form1.submit(); 212} 213 214function fnSubmit() { 215 document.form1.submit(); 216} 217 218// ãã¤ã³ãå ¥åå¶éã 219function fnCheckInputPoint() { 220 if (document.form1['point_check']) { 221 list = new Array( 222 'use_point' 223 ); 224 225 if (!document.form1['point_check'][0].checked) { 226 color = "#dddddd"; 227 flag = true; 228 } else { 229 color = ""; 230 flag = false; 231 } 232 233 len = list.length 234 for (i = 0; i < len; i++) { 235 if (document.form1[list[i]]) { 236 document.form1[list[i]].disabled = flag; 237 document.form1[list[i]].style.backgroundColor = color; 238 } 239 } 240 } 241} 242 243// å¥ã®ãå±ãå å ¥åå¶éã 244function fnCheckInputDeliv() { 245 if (!document.form1) { 246 return; 247 } 248 if (document.form1['deliv_check']) { 249 list = new Array( 250 'shipping_name01', 251 'shipping_name02', 252 'shipping_kana01', 253 'shipping_kana02', 254 'shipping_pref', 255 'shipping_zip01', 256 'shipping_zip02', 257 'shipping_addr01', 258 'shipping_addr02', 259 'shipping_tel01', 260 'shipping_tel02', 261 'shipping_tel03' 262 ); 263 264 if (!document.form1['deliv_check'].checked) { 265 fnChangeDisabled(list, '#dddddd'); 266 } else { 267 fnChangeDisabled(list, ''); 268 } 269 } 270} 271 272// æåã«è¨å®ããã¦ããè²ãä¿åãã¦ããã 273var g_savecolor = new Array(); 274 275function fnChangeDisabled(list, color) { 276 len = list.length; 277 278 for (i = 0; i < len; i++) { 279 if (document.form1[list[i]]) { 280 if (color == "") { 281 // æå¹ã«ããã 282 document.form1[list[i]].disabled = false; 283 document.form1[list[i]].style.backgroundColor = g_savecolor[list[i]]; 284 } else { 285 // ç¡å¹ã«ããã 286 document.form1[list[i]].disabled = true; 287 g_savecolor[list[i]] = document.form1[list[i]].style.backgroundColor; 288 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 289 } 290 } 291 } 292} 293 294 295// ãã°ã¤ã³æã®å ¥åãã§ã㯠296function fnCheckLogin(formname) { 297 var lstitem = new Array(); 298 299 if (formname == 'login_mypage') { 300 lstitem[0] = 'mypage_login_email'; 301 lstitem[1] = 'mypage_login_pass'; 302 } else { 303 lstitem[0] = 'login_email'; 304 lstitem[1] = 'login_pass'; 305 } 306 var max = lstitem.length; 307 var errflg = false; 308 var cnt = 0; 309 310 //ãå¿ é é ç®ã®ãã§ã㯠311 for (cnt = 0; cnt < max; cnt++) { 312 if (document.forms[formname][lstitem[cnt]].value == "") { 313 errflg = true; 314 break; 315 } 316 } 317 318 // å¿ é é ç®ãå ¥åããã¦ããªãå ´å 319 if (errflg == true) { 320 alert('ã¡ã¼ã«ã¢ãã¬ã¹/ãã¹ã¯ã¼ããå ¥åãã¦ä¸ããã'); 321 return false; 322 } 323} 324 325// æéã®è¨æ¸¬. 326function fnPassTime() { 327 end_time = new Date(); 328 time = end_time.getTime() - start_time.getTime(); 329 alert((time / 1000)); 330} 331 332start_time = new Date(); 333 334//親ã¦ã£ã³ãã¦ã®ãã¼ã¸ã夿´ãã. 335function fnUpdateParent(url) { 336 // 親ã¦ã£ã³ãã¦ã®åå¨ç¢ºèª 337 if (fnIsopener()) { 338 window.opener.location.href = url; 339 window.opener.location.reload(); 340 } else { 341 window.close(); 342 } 343} 344 345//ç¹å®ã®ãã¼ãSUBMITãã. 346function fnKeySubmit(keyname, keyid) { 347 if (keyname != "" && keyid != "") { 348 document.form1[keyname].value = keyid; 349 } 350 document.form1.submit(); 351} 352 353//æåæ°ãã«ã¦ã³ãããã 354//弿°1ï¼ãã©ã¼ã åç§° 355//弿°2ï¼æåæ°ã«ã¦ã³ã対象 356//弿°3ï¼ã«ã¦ã³ãçµææ ¼ç´å¯¾è±¡ 357function fnCharCount(form, sch, cnt) { 358 document.forms[form][cnt].value = document.forms[form][sch].value.length; 359} 360 361 362// ããã¹ãã¨ãªã¢ã®ãµã¤ãºã夿´ãã. 363function ChangeSize(buttonSelector, textAreaSelector, max, min) { 364 365 if ($(textAreaSelector).attr('rows') <= min) { 366 $(textAreaSelector).attr('rows', max); 367 $(buttonSelector).text('縮å°'); 368 } else { 369 $(textAreaSelector).attr('rows', min); 370 $(buttonSelector).text('æ¡å¤§'); 371 } 372} 373 374function fnAddFigure(str) { 375 str = str + ""; 376 var num = new String(str).replace(/,/g, ""); 377 while (num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2"))) ; 378 return num; 379} 380 381function fnIsPositiveInteger(str) { 382 str = str + ""; 383 str = str.replace(/,/g, ""); 384 if (isNaN(str) || str == "" || parseInt(str) < 0) { 385
vendor: 37 bytes, lines 385-389
385 return false; 386 } 387 return true; 388} 389
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.