1// JavaScript Document 2 3//---------------------------------------- 4// ã®ãããã·ãã¥ã¬ã¼ã·ã§ã³ start 5//---------------------------------------- 6 // textare insert start ----------------- 7 8 function setGiftTextArea(){ 9 10 var resultText = ''; 11 12 if( $('#giftAutoCalculation tr.giftItemRow').length){ 13 14 // åå鏿ããã£ãå ´å 15 16 $('#giftAutoCalculation tr.giftItemRow').each(function() { 17 18 var giftName = $(this).find("td.giftItem").text(); 19 var giftNum = $(this).find("td.giftNum").text(); 20 var giftPrice = $(this).find("td.onePrice").text(); 21 22 var rowText = `${giftName} : åæ° ${giftNum} : ä¾¡æ ¼ ${giftPrice}\n`; 23 resultText += rowText; 24 25 }); 26 27 var textareaTotalPrice = $("#giftAutoCalculation .giftPriceAdd em").text(); 28 29           resultText += `ç®å®éé¡:${textareaTotalPrice}å`; 30 31 $('textarea#choiceGiftTextarea').val(resultText); 32 33 }else{ 34 35 // åå鏿ããªãå ´å 36 37 $('textarea#choiceGiftTextarea').val(""); 38 39 } 40 41 } 42 43 // 鏿ã¢ã¤ãã ã®å ¨åé¤ start --------------- 44 45 $("#giftAutoCalculation .giftClear").on("click",function(){ 46 47 $("#giftAutoCalculation .choicedGift table .giftItemRow").remove(); 48 $("#giftAutoCalculation .giftPriceAdd em").text(0); 49 $("textarea#choiceGiftTextarea").val(""); 50 51 }); 52 53 // 鏿ã¢ã¤ãã ã®å ¨åé¤ end --------------- 54 55 //ãåè¨éé¡ã®ç®åºãstart ------------------- 56 57 function giftTotalPrice(){ 58 59 let total = 0; 60 61 if($("#giftAutoCalculation .choicedGift table td").length){ 62 63 $('#giftAutoCalculation .choicedGift .onePrice').each(function() { 64 65 total += parseFloat($(this).data('onetotal')) || 0; 66 67 }); 68 69 } 70 71 var formatTotal = total.toLocaleString(); 72 73 $("#giftAutoCalculation .giftPriceAdd em").text(formatTotal); 74 75 } 76 77 //ãåè¨éé¡ã®ç®åºãend ------------------- 78 79 // 鏿ã¢ã¤ãã ã®åé¤ãstart ---------------- 80 81 $(document).on("click","#giftAutoCalculation td.delete em",function(){ 82 83 console.log(1); 84 85 var parrentElement = $(this).parent().parent(); 86 87 parrentElement.remove(); 88 89 // åè¨éé¡ã®è¨ç® 90 91 giftTotalPrice(); 92 setGiftTextArea(); 93 94 }); 95 96 // 鏿ã¢ã¤ãã ã®åé¤ãend ---------------- 97 98 // 鏿ã®ããã®è¿½å start ------------------- 99 100 $("#giftAutoCalculation .giftAdd").on("click",function(){ 101 102 var addGiftValue = $("#giftAutoCalculation option:selected").val(); 103 104 if(addGiftValue != ""){ 105 106 var addGiftText = $("#giftAutoCalculation option:selected").text(); 107 108 // æ°è¦è¿½å ãã夿´ã夿 109 110 if( $("#giftAutoCalculation .choicedGift table tr td").length){ 111 112 113 // ãã§ã«åå¨ãã¦ãããç¢ºèª 114 115 var addCount = 0; 116 117 $('#giftAutoCalculation td.giftItem').each(function() { 118 119 if ($(this).text().includes(addGiftText)) { 120 121 // åæ°ã®è¿½å 122 123 var thisNumber = $(this).next('td').text(); 124 var tnisNumber_number = Number(thisNumber); 125 var aftterNumber = tnisNumber_number + 1; 126 $(this).next('td').text(aftterNumber); 127 128 // éé¡ã®å¤æ´ 129 130 var onePrice = $(this).data("oneprice"); 131 132 console.log(aftterPrice); 133 var aftterPrice = aftterNumber * Number(onePrice); 134 135 var formatPrice = aftterPrice.toLocaleStr
135ing(); 136 $(this).next('td').next('td').text(`${formatPrice}åã`); 137 $(this).next('td').next('td').data("onetotal",aftterPrice); 138 139 addCount++; 140 141 } 142 }); 143 144 if(addCount == 0){ 145 146 addGiftValue = Number(addGiftValue); 147 148 var formatPrice = addGiftValue.toLocaleString(); 149 150 $("#giftAutoCalculation .choicedGift table").append(` 151 <tr class="giftItemRow"> 152 <td class="delete"> 153 <em>âï¸</em> 154 </td> 155 <td class="giftItem" data-onePrice="${addGiftValue}">${addGiftText}</td> 156 <td class="giftNum">1</td> 157 <td class="onePrice" data-onetotal="${addGiftValue}">${formatPrice}åã</td> 158 </tr> 159 `); 160 161 } 162 163 }else{ 164 165 // æ°è¦è¿½å 166 addGiftValue = Number(addGiftValue); 167 168 var formatPrice = addGiftValue.toLocaleString(); 169 170 $("#giftAutoCalculation .choicedGift table").append(` 171 <tr class="giftItemRow"> 172 <td class="delete"> 173 <em>âï¸</em> 174 </td> 175 <td class="giftItem" data-onePrice="${addGiftValue}">${addGiftText}</td> 176 <td class="giftNum">1</td> 177 <td class="onePrice" data-onetotal="${addGiftValue}">${formatPrice}åã</td> 178 </tr> 179 `); 180 } 181 182 // åè¨éé¡ã®è¨ç® 183 184 giftTotalPrice(); 185 setGiftTextArea(); 186 187 } 188 189 }); 190$("#giftAutoCalculation").appendTo(".giftSimyuBox"); 191//---------------------------------------- 192// ã®ãããã·ãã¥ã¬ã¼ã·ã§ã³ end 193//---------------------------------------- 194 195//---------------------------------------- 196// éæ¾ ã·ãã¥ã¬ã¼ã·ã§ã³ start 197//---------------------------------------- 198 // textare insert start ----------------- 199 200 function setKadoTextArea(){ 201 202 var resultText = ''; 203 204 if( $('#kadoAutoCalculation tr.kadoItemRow').length){ 205 206 // åå鏿ããã£ãå ´å 207 208 $('#kadoAutoCalculation tr.kadoItemRow').each(function() { 209 210 var giftName = $(this).find("td.kadoItem").text(); 211 var giftNum = $(this).find("td.kadoNum").text(); 212 var giftPrice = $(this).find("td.onePrice").text(); 213 214 var rowText = `ã®ããå ${giftName} : åæ° ${giftNum} : ä¾¡æ ¼ ${giftPrice}\n`; 215 resultText += rowText; 216 217 }); 218 219 var textareaTotalPrice = $("#kadoAutoCalculation .kadoPriceAdd em").text(); 220 221 resultText += `ç®å®éé¡:${textareaTotalPrice}`; 222 223 $('textarea#choiceKadoTextarea').val(resultText); 224 225 }else{ 226 227 // åå鏿ããªãå ´å 228 229 $('textarea#choiceKadoTextarea').val(""); 230 231 } 232 233 } 234 235 // 鏿ã¢ã¤ãã ã®å ¨åé¤ start --------------- 236 237 $("#kadoAutoCalculation .kadoClear").on("click",function(){ 238 239 $("#kadoAutoCalculation .choicedKado table .kadoItemRow").remove(); 240 $("#kadoAutoCalculation .kadoPriceAdd em").text(0); 241 $("textarea#choiceKadoTextarea").val(""); 242 243 }); 244 245 // 鏿ã¢ã¤ãã ã®å ¨åé¤ end --------------- 246 247 // åè¨éé¡ã®ç®åº start ------------------- 248 249 function kadoTotalPrice(){ 250 251 let total = 0; 252 253 if($("#kadoAutoCalculation .choicedKado table td").length){ 254 255 $('#kadoAutoCalculation .choicedKado .onePrice').each(function() { 256 257 total += parseFloat($(this).data('onetotal')) || 0; 258 259 }); 260 261 } 262 263 var formatTotal = total.toLocaleString(); 264 265 $("#kadoAutoCalculation .kadoPriceAdd em").text(formatTotal); 266 267 } 268 269 // åè¨éé¡ã®ç®åº end ------------------- 270 271 // 鏿ã¢ã¤ãã ã®åé¤ start ---------------- 272 273 $(document).on("click","#kadoAutoCalculation td.delete em",function(){ 274 275 console.log(1); 276 277 var parrentElement = $(this).parent().parent(); 278 279 parrentElement.remove(); 280 281 // åè¨éé¡ã®è¨ç® 282 283 kadoTotalPrice(); 284 setKadoTextArea(); 285 286 }); 287 288 // 鏿ã¢ã¤ãã ã®åé¤ end ---------------- 289 290 // 鏿ã®ããã®è¿½å start ------------------- 291 292 $("#kadoAutoCalculation .kadoAdd").on("click",function(){ 293 294 var addGiftValue = $("#kadoAutoCalculation option:selected").val(); 295 296 if(addGiftValue != ""){ 297 298 var addGiftText = $("#kadoAutoCalculation option:selected").text(); 299 300 // æ°è¦è¿½å ãã夿´ã夿 301 302 if( $("#kadoAutoCalculation .choicedKado table tr td").length){ 303 304 305 // ãã§ã«åå¨ãã¦ãããç¢ºèª 306 307 var addCount = 0; 308 309 $('#kadoAutoCalculation td.kadoItem').each(function() { 310 311 if ($(this).text().includes(addGiftText)) { 312 313 // åæ°ã®è¿½å 314 315 var thisNumber = $(this).next('td').text(); 316 var tnisNumber_number = Number(thisNumber);
317 var aftterNumber = tnisNumber_number + 1; 318 $(this).next('td').text(aftterNumber); 319 320 // éé¡ã®å¤æ´ 321 322 var onePrice = $(this).data("oneprice"); 323 324 console.log(aftterPrice); 325 var aftterPrice = aftterNumber * Number(onePrice); 326 327 var formatPrice = aftterPrice.toLocaleString(); 328 $(this).next('td').next('td').text(`${formatPrice}å`); 329 $(this).next('td').next('td').data("onetotal",aftterPrice); 330 331 addCount++; 332 333 } 334 }); 335 336 if(addCount == 0){ 337 338 addGiftValue = Number(addGiftValue); 339 340 var formatPrice = addGiftValue.toLocaleString(); 341 342 $("#kadoAutoCalculation .choicedKado table").append(` 343 <tr class="kadoItemRow"> 344 <td class="delete"> 345 <em>âï¸</em> 346 </td> 347 <td class="kadoItem" data-onePrice="${addGiftValue}">${addGiftText}</td> 348 <td class="kadoNum">1</td> 349 <td class="onePrice" data-onetotal="${addGiftValue}">${formatPrice}å</td> 350 </tr> 351 `); 352 353 } 354 355 }else{ 356 357 // æ°è¦è¿½å 358 addGiftValue = Number(addGiftValue); 359 360 var formatPrice = addGiftValue.toLocaleString(); 361 362 $("#kadoAutoCalculation .choicedKado table").append(` 363 <tr class="kadoItemRow"> 364 <td class="delete"> 365 <em>âï¸</em> 366 </td> 367 <td class="kadoItem" data-onePrice="${addGiftValue}">${addGiftText}</td> 368 <td class="kadoNum">1</td> 369 <td class="onePrice" data-onetotal="${addGiftValue}">${formatPrice}å</td> 370 </tr> 371 `); 372 } 373 374 // åè¨éé¡ã®è¨ç® 375 376 kadoTotalPrice(); 377 setKadoTextArea(); 378 379 } 380 381 }); 382 383 // 鏿ã®ããã®è¿½å end ------------------- 384 385//---------------------------------------- 386// éæ¾ ã·ãã¥ã¬ã¼ã·ã§ã³ end 387//----------------------------------------
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.