1//----------------------------------------- 2//表示ã»é表示ã®åãæã 3//----------------------------------------- 4function in2cart_toggle(id, page_id) { 5 var flag = ""; 6 if(document.getElementById(id)) { 7 if(jQuery('#' + id).is(':hidden')) { 8 jQuery('#' + id).show(); 9 flag = "show"; 10 } else { 11 jQuery('#' + id).hide(); 12 flag = "hide"; 13 } 14 if(id == "searchBox") { 15 jQuery.cookie(id + "_" + page_id, flag, { expires: 7 }); 16 } 17 } 18} 19 20//------------------------------------------------ 21//ãµãããã 22//------------------------------------------------ 23function in2jump(url, formID, mode) { 24 if(formID == undefined) formID = 0; 25 if(mode != undefined) { 26 document.forms[formID].mode.value = mode; 27 } 28 if(url != undefined && url != "") { 29 document.forms[formID].action = url; 30 } 31 document.forms[formID].submit(); 32} 33 34//------------------------------------------------ 35//ã¢ã©ã¼ããã¤ã¢ãã° 36//------------------------------------------------ 37function in2Dialog(msg) { 38 alert(msg); 39} 40 41//------------------------------------------------ 42//確èªãã¤ã¢ãã° 43//------------------------------------------------ 44function in2ConfirmDialog(msg) { 45 if(window.confirm(msg)) { 46 return true; 47 } else { 48 return false; 49 } 50} 51 52//------------------------------------------------ 53//URLã®ã¯ã¨ãªåå¾ 54//------------------------------------------------ 55function in2ReadParse() { 56 var vars = [], hash; 57 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 58 for(var i = 0; i < hashes.length; i++) { 59 hash = hashes[i].split('='); 60 vars.push(hash[0]); 61 vars[hash[0]] = hash[1]; 62 } 63 return vars; 64} 65 66//------------------------------------------------ 67//URLã¸ã¯ã¨ãªæåå使 68//------------------------------------------------ 69function in2UrlQuery(query) { 70 var arrData = new Array(); 71 for(var key in query) { 72 arrData.push(key + "=" + encodeURI(query[key])); 73 } 74 75 return arrData.join("&"); 76} 77 78//------------------------------------------------ 79//Window open 80//------------------------------------------------ 81function wopen(URL, Winname, Wwidth, Wheight){ 82 var WIN; 83 WIN = window.open(URL,Winname,"width="+Wwidth+",height="+Wheight+",scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 84 WIN.focus(); 85} 86 87//------------------------------------------------ 88//htmlã¨ã¹ã±ã¼ã 89//------------------------------------------------ 90function escapeHtml(str) { 91 return str.replace(/&/g, '&') 92 .replace(/</g, '<') 93 .replace(/>/g, '>') 94 .replace(/"/g, '"') 95 .replace(/'/g, '''); 96} 97 98//------------------------------------------------ 99//htmlã¢ã³ã¨ã¹ã±ã¼ã 100//------------------------------------------------ 101function unescapeHtml(str) { 102 if(str == undefined || str == "") return ""; 103 104 str = str.replace(/&/g, '&') 105 .replace(/</g, '<') 106 .replace(/>/g, '>') 107 .replace(/"/g, '"') 108 .replace(/'/g, "'") 109 .replace(/×/g, "Ã"); 110 111 return str; 112// return jQuery('<div>').html(str).text(); 113 114} 115 116/* 117var escapeHtml = (function (String) { 118 var escapeMap = { 119 '&': '&', 120 "'": ''', 121 '`': '`', 122 '"': '"', 123 '<': '<', 124 '>': '>' 125 }; 126 var escapeReg = '['; 127 var reg; 128 for (var p in escapeMap) { 129 if (escapeMap.hasOwnProperty(p)) { 130 escapeReg += p; 131 } 132 } 133 escapeReg += ']'; 134 reg = new RegExp(escapeReg, 'g'); 135 return function escapeHtml (str) { 136 str = (str === null || str === undefined) ? '' : '' + str; 137 return str.replace(reg, function (match) { 138 return escapeMap[match]; 139 }); 140 }; 141}(String)); 142*/ 143 144//------------------------------------------------ 145//é貨ã®ã«ã³ãåºåã 146//------------------------------------------------ 147function number_format(val){ 148 return val.replace( /(\d)(?=(\d\d\d)+(?!\d))/g, '$1,' ); 149} 150 151//------------------------------------------------ 152//æ´æ°ãå¤å® 153//------------------------------------------------ 154function wd_is_number(val){ 155 // ãã§ãã¯æ¡ä»¶ãã¿ã¼ã³ 156// var pattern = /^[-]?([1-9]\d*|0)(\.\d+)?$/; 157 var pattern = /^([1-9]\d*|0)$/; 158 // æ°å¤ãã§ã㯠159 return pattern.test(val); 160} 161 162//------------------------------------------------ 163//0åã 164//------------------------------------------------ 165function wd_zero_padding(val, num) { 166 167 var arrZero = new Array(); 168 for(var i = 0; i < num; i++) { 169 arrZero.push("0"); 170 } 171 172 return (arrZero.join("") + val).slice(num * -1) 173} 174 175//----------------------------------------- 176//å種ajaxå¦ç 177//----------------------------------------- 178function wd_common_ajax(self, action, option) { 179 180 //ajax 181 var hshData = {}; 182 hshData["action"] = action; 183 hshData["option"] = option 184 hshData["token"] = WD.js_token; 185 186 //ãªã¼ãã¼ã¬ã¤ä½æ 187 if("overlay" in option) { 188 if(option["overlay"] == "in2cart") { 189 in2cart_create_overlay("open"); 190 } else if(option["overlay"] == "pdf_queue") { 191 jQuery(".message_history").html("<img id='loading' src='images/loading.gif'>"); 192 } 193 } else { 194 jQuery(self).after("<img id='loading' src='images/loading.gif'>"); 195 } 196 197 jQuery.ajax({ 198 url: WD.endpoint, 199 type: "POST", 200 cache: false, 201 async: true, 202 data: hshData, 203 success: function(data) { 204 var json = jQuery.parseJSON(data); 205 if(json.result == 0) { 206 if("no_alert" in option) { 207 208 } else { 209 wdDialog(json.msg); 210 } 211 212 //ã¨ã©ã¼è¡¨ç¤º 213 if("error" in json) { 214 in2FormError(json.error, true); 215 } 216 217 return false; 218 } 219 220 if(option.callback) { 221 option.callback(json); 222 } 223 }, 224 error: function() { 225 }, 226 complete: function() { 227 if("overlay" in option) { 228 if(option["overlay"] == "in2cart") { 229 in2cart_create_overlay("close"); 230 } 231 } else { 232 jQuery("#loading").remove(); 233 } 234 235// wdgp_create_overlay("close"); 236// jQuery("#loading").remove(); 237 } 238 }); 239} 240 241/** 242 * å ±éãã¡ã¤ã«ã¢ãããã¼ãajaxå¦ç 243 * 244 * @param element self 245 * @param string option 246 */ 247function wd_common_upload_ajax(self, option) { 248 in2FormError({}, false); 249 jQuery(self).after("<img id='loading' src='images/loading.gif'>"); 250 251 jQuery.ajax({ 252 url: WD.endpoint, 253 type: "POST", 254 cache: false, 255 async: true, 256 data: option["formData"], 257 contentType: false, 258 processData: false, 259 success: function(data) { 260 var json = jQuery.parseJSON(data); 261 if(json.result == 0) { 262 if(json.msg != "") { 263 wdDialog(json.msg); 264 } 265 in2FormError(json.error, true); 266 return false; 267 } 268 269 if(option.callback) { 270 option.callback(json); 271 } 272 273 // ã¨ã©ã¼ã®ãªã»ãã 274 // wd_form_error({}); 275 }, 276 error: function() { 277 wdDialog("ã¢ãããã¼ãã«å¤±æãã¾ãã"); 278 }, 279 complete: function() { 280 jQuery("#loading").remove(); 281 } 282 }); 283} 284 285function wdDialog(msg) { 286 alert(msg); 287} 288 289//------------------------------------------------ 290//ãã§ãã¯ããã¯ã¹ã®ãã§ãã¯ã«ããèæ¯è²ãå¤ãã 291//------------------------------------------------ 292function wd_change_tr_color(self) { 293 var check = jQuery(self).prop("checked"); 294 if(check) { 295 jQuery(self).closest("tr").find("td").css("background-color", "#fffbde"); 296 } else { 297 jQuery(self).closest("tr").find("td").css("background-color", ""); 298 } 299 300 // å ¨ã¦ã®ãã§ãã¯ã®ç¢ºèª 301 var is_all_check = true; 302 jQuery(self).closest("table").find(".delete_checks").each(function() { 303 var check = jQuery(this).prop("checked"); 304 if(!check) { 305 is_all_check = false; 306 return false; 307 } 308 });
309 if(is_all_check) { 310 jQuery(self).closest("table").find(".all_delete_check").prop("checked", true); 311 } else { 312 jQuery(self).closest("table").find(".all_delete_check").prop("checked", false); 313 } 314} 315 316/** 317 * 空 or undefinedããå¤å® 318 * 319 * @param {string} val 320 * @returns 321 */ 322function wd_empty(val) { 323 if(val == "" || val === undefined) { 324 return true; 325 } else { 326 return false; 327 } 328} 329 330//------------------------------------------------ 331//ã³ã³ã½ã¼ã«ãã° 332//------------------------------------------------ 333function clog(v) { if(!document.all) console.log(v); }
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.