https://turkishmart.ca/cdn/shop/t/23/assets/jquery.currencies.min.js?v=35452912321688254271693061393
1/* 2 * Cookie plugin 3 * 4 * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 * 9 */ 10 11jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}}; 12 13/* 14 * Currency tools 15 * 16 * Copyright (c) 2015 Caroline Schnapp ([email protected]) 17 * Licensed under the MIT license: 18 * http://www.opensource.org/licenses/mit-license.php 19 * 20 */ 21 22if (typeof Currency === 'undefined') { 23 var Currency = {}; 24} 25 26Currency.cookie = { 27 configuration: { 28 expires: 365, 29 path: '/', 30 domain: window.location.hostname 31 }, 32 name: 'currency', 33 write: function(currency) { 34 jQuery.cookie(this.name, currency, this.configuration); 35 }, 36 read: function() { 37 return jQuery.cookie(this.name); 38 }, 39 destroy: function() { 40 jQuery.cookie(this.name, null, this.configuration); 41 } 42}; 43 44Currency.moneyFormats = { 45 "USD":{ 46 "money_format":"${{amount}}", 47 "money_with_currency_format":"${{amount}} USD" 48 }, 49 "EUR":{ 50 "money_format":"€{{amount}}", 51 "money_with_currency_format":"€{{amount}} EUR" 52 }, 53 "GBP":{ 54 "money_format":"£{{amount}}", 55 "money_with_currency_format":"£{{amount}} GBP" 56 }, 57 "CAD":{ 58 "money_format":"${{amount}}", 59 "money_with_currency_format":"${{amount}} CAD" 60 }, 61 "ALL":{ 62 "money_format":"Lek {{amount}}", 63 "money_with_currency_format":"Lek {{amount}} ALL" 64 }, 65 "DZD":{ 66 "money_format":"DA {{amount}}", 67 "money_with_currency_format":"DA {{amount}} DZD" 68 }, 69 "AOA":{ 70 "money_format":"Kz{{amount}}", 71 "money_with_currency_format":"Kz{{amount}} AOA" 72 }, 73 "ARS":{ 74 "money_format":"${{amount_with_comma_separator}}", 75 "money_with_currency_format":"${{amount_with_comma_separator}} ARS" 76 }, 77 "AMD":{ 78 "money_format":"{{amount}} AMD", 79 "money_with_currency_format":"{{amount}} AMD" 80 }, 81 "AWG":{ 82 "money_format":"Afl{{amount}}", 83 "money_with_currency_format":"Afl{{amount}} AWG" 84 }, 85 "AUD":{ 86 "money_format":"${{amount}}", 87 "money_with_currency_format":"${{amount}} AUD" 88 }, 89 "BBD":{ 90 "money_format":"${{amount}}", 91 "money_with_currency_format":"${{amount}} Bds" 92 }, 93 "AZN":{ 94 "money_format":"m.{{amount}}", 95 "money_with_currency_format":"m.{{amount}} AZN" 96 }, 97 "BDT":{ 98 "money_format":"Tk {{amount}}", 99 "money_with_currency_format":"Tk {{amount}} BDT" 100 }, 101 "BSD":{ 102 "money_format":"BS${{amount}}", 103 "money_with_currency_format":"BS${{amount}} BSD" 104 }, 105 "BHD":{ 106 "money_format":"{{amount}}0 BD", 107 "money_with_currency_format":"{{amount}}0 BHD" 108 }, 109 "BYR":{ 110 "money_format":"Br {{amount}}", 111 "money_with_currency_format":"Br {{amount}} BYR" 112 }, 113 "BZD":{ 114 "money_format":"BZ${{amount}}", 115 "money_with_currency_format":"BZ${{amount}} BZD" 116 }, 117 "BTN":{ 118 "money_format":"Nu {{amount}}", 119 "money_with_currency_format":"Nu {{amount}} BTN" 120 }, 121 "BAM":{ 122 "money_format":"KM {{amount_with_comma_separator}}", 123 "money_with_currency_format":"KM {{amount_with_comma_separator}} BAM" 124 }, 125 "BRL":{ 126 "money_format":"R$ {{amount_with_comma_separator}}", 127 "money_with_currency_format":"R$ {{amount_with_comma_separator}} BRL" 128 }, 129 "BOB":{ 130 "money_format":"Bs{{amount_with_comma_separator}}", 131 "money_with_currency_format":"Bs{{amount_with_comma_separator}} BOB" 132 }, 133 "BWP":{ 134 "money_format":"P{{amount}}", 135 "money_with_currency_format":"P{{amount}} BWP" 136 }, 137 "BND":{ 138 "money_format":"${{amount}}", 139 "money_with_currency_format":"${{amount}} BND" 140 }, 141 "BGN":{ 142 "money_format":"{{amount}} ??", 143 "money_with_currency_format":"{{amount}} ?? BGN" 144 }, 145 "MMK":{ 146 "money_format":"K{{amount}}", 147 "money_with_currency_format":"K{{amount}} MMK" 148 }, 149 "KHR":{ 150 "money_format":"KHR{{amount}}", 151 "money_with_currency_format":"KHR{{amount}}" 152 }, 153 "KYD":{ 154 "money_format":"${{amount}}", 155 "money_with_currency_format":"${{amount}} KYD" 156 }, 157 "XAF":{ 158 "money_format":"FCFA{{amount}}", 159 "money_with_currency_format":"FCFA{{amount}} XAF" 160 }, 161 "CLP":{ 162 "money_format":"${{amount_no_decimals}}", 163 "money_with_currency_format":"${{amount_no_decimals}} CLP" 164 }, 165 "CNY":{ 166 "money_format":"¥{{amount}}", 167 "money_with_currency_format":"¥{{amount}} CNY" 168 }, 169 "COP":{ 170 "money_format":"${{amount_with_comma_separator}}", 171 "money_with_currency_format":"${{amount_with_comma_separator}} COP" 172 }, 173 "CRC":{ 174 "money_format":"₡ {{amount_with_comma_separator}}", 175 "money_with_currency_format":"₡ {{amount_with_comma_separator}} CRC" 176 }, 177 "HRK":{ 178 "money_format":"{{amount_with_comma_separator}} kn", 179 "money_with_currency_format":"{{amount_with_comma_separator}} kn HRK" 180 }, 181 "CZK":{ 182 "money_format":"{{amount_with_comma_separator}} Kč", 183 "money_with_currency_format":"{{amount_with_comma_separator}} Kč" 184 }, 185 "DKK":{ 186 "money_format":"{{amount_with_comma_separator}}", 187 "money_with_currency_format":"kr.{{amount_with_comma_separator}}" 188 }, 189 "DOP":{ 190 "money_format":"RD$ {{amount}}", 191 "money_with_currency_format":"RD$ {{amount}}" 192 }, 193 "XCD":{ 194 "money_format":"${{amount}}", 195 "money_with_currency_format":"EC${{amount}}" 196 }, 197 "EGP":{ 198 "money_format":"LE {{amount}}", 199 "money_with_currency_format":"LE {{amount}} EGP" 200 }, 201 "ETB":{ 202 "money_format":"Br{{amount}}", 203 "money_with_currency_format":"Br{{amount}} ETB" 204 }, 205 "XPF":{ 206 "money_format":"{{amount_no_decimals_with_comma_separator}} XPF", 207 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} XPF" 208 }, 209 "FJD":{ 210 "money_format":"${{amount}}", 211 "money_with_currency_format":"FJ${{amount}}" 212 }, 213 "GMD":{ 214 "money_format":"D {{amount}}", 215 "money_with_currency_format":"D {{amount}} GMD" 216 }, 217 "GHS":{ 218 "money_format":"GH₵{{amount}}", 219 "money_with_currency_format":"GH₵{{amount}}" 220 }, 221 "GTQ":{ 222 "money_format":"Q{{amount}}", 223 "money_with_currency_format":"{{amount}} GTQ" 224 }, 225 "GYD":{ 226 "money_format":"G${{amount}}", 227 "money_with_currency_format":"${{amount}} GYD" 228 }, 229 "GEL":{ 230 "money_format":"{{amount}} GEL", 231 "money_with_currency_format":"{{amount}} GEL" 232 }, 233 "HNL":{ 234 "money_format":"L {{amount}}", 235 "money_with_currency_format":"L {{amount}} HNL" 236 }, 237 "HKD":{ 238 "money_format":"${{amount}}", 239 "money_with_currency_format":"HK${{amount}}" 240 }, 241 "HUF":{ 242 "money_format":"{{amount_no_decimals_with_comma_separator}}", 243 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} Ft" 244 }, 245 "ISK":{ 246 "money_format":"{{amount_no_decimals}} kr", 247 "money_with_currency_format":"{{amount_no_decimals}} kr ISK" 248 }, 249 "INR":{ 250 "money_format":"Rs. {{amount}}", 251 "money_with_currency_format":"Rs. {{amount}}" 252 }, 253 "IDR":{ 254 "money_format":"{{amount_with_comma_separator}}", 255 "money_with_currency_format":"Rp {{amount_with_comma_separator}}" 256 }, 257 "ILS":{ 258 "money_format":"{{amount}} NIS", 259 "money_with_currency_format":"{{amount}} NIS" 260 }, 261 "JMD":{ 262 "money_format":"${{amount}}", 263 "money_with_currency_format":"${{amount}} JMD" 264 }, 265 "JPY":{ 266 "money_format":"¥{{amount_no_decimals}}", 267 "money_with_currency_format":"¥{{amount_no_decimals}} JPY" 268 }, 269 "JEP":{ 270 "money_format":"£{{amount}}", 271 "money_with_currency_format":"£{{amount}} JEP" 272 }, 273 "JOD":{ 274 "money_format":"{{amount}}0 JD", 275 "money_with_currency_format":"{{amount}}0 JOD" 276 }, 277 "KZT":{ 278 "money_format":"{{amount}} KZT", 279 "money_with_currency_format":"{{amount}} KZT" 280 }, 281 "KES":{ 282 "money_format":"KSh{{amount}}", 283 "money_with_currency_format":"KSh{{amount}}" 284 }, 285 "KWD":{ 286 "money_format":"{{amount}}0 KD", 287 "money_with_currency_format":"{{amount}}0 KWD" 288 }, 289 "KGS":{ 290 "money_format":"??{{amount}}", 291 "money_with_currency_format":"??{{amount}}" 292 }, 293 "LVL":{ 294 "money_format":"Ls {{amount}}", 295 "money_with_currency_format":"Ls {{amount}} LVL" 296 }, 297 "LBP":{ 298 "money_format":"L£{{amount}}", 299 "money_with_currency_format":"L£{{amount}} LBP" 300 }, 301 "LTL":{ 302 "money_format":"{{amount}} Lt", 303 "money_with_currency_format":"{{amount}} Lt" 304 }, 305 "MGA":{ 306 "money_format":"Ar {{amount}}", 307 "money_with_currency_format":"Ar {{amount}} MGA" 308 }, 309 "MKD":{ 310 "money_format":"??? {{amount}}", 311 "money_with_currency_format":"??? {{amount}} MKD" 312 }, 313 "MOP":{ 314 "money_format":"MOP${{amount}}", 315 "money_with_currency_format":"MOP${{amount}}" 316 }, 317 "MVR":{ 318 "money_format":"Rf{{amount}}", 319 "money_with_currency_format":"Rf{{amount}} MRf" 320 }, 321 "MXN":{ 322 "money_format":"$ {{amount}}", 323 "money_with_currency_format":"$ {{amount}} MXN" 324 }, 325 "MYR":{ 326 "money_format":"RM{{amount}} MYR", 327 "money_with_currency_format":"RM{{amount}} MYR" 328 }, 329 "MUR":{ 330 "money_format":"Rs {{amount}}", 331 "money_with_currency_format":"Rs {{amount}} MUR" 332 }, 333 "MDL":{ 334 "money_format":"{{amount}} MDL", 335 "money_with_currency_format":"{{amount}} MDL" 336 }, 337 "MAD":{ 338 "money_format":"{{amount}} dh", 339 "money_with_currency_format":"Dh {{amount}} MAD" 340 }, 341 "MNT":{ 342 "money_format":"{{amount_no_decimals}} ₮", 343 "money_with_currency_format":"{{amount_no_decimals}} MNT" 344 }, 345 "MZN":{ 346 "money_format":"{{amount}} Mt", 347 "money_with_currency_format":"Mt {{amount}} MZN" 348 }, 349 "NAD":{ 350 "money_format":"N${{amount}}", 351 "money_with_currency_format":"N${{amount}} NAD" 352 }, 353 "NPR":{ 354 "money_format":"Rs{{amount}}", 355 "money_with_currency_format":"Rs{{amount}} NPR" 356 }, 357 "ANG":{ 358 "money_format":"ƒ{{amount}}", 359 "money_with_currency_format":"{{amount}} NAƒ" 360 }, 361 "NZD":{ 362 "money_format":"${{amount}}", 363 "money_with_currency_format":"${{amount}} NZD" 364 }, 365 "NIO":{ 366 "money_format":"C${{amount}}", 367 "money_with_currency_format":"C${{amount}} NIO" 368 }, 369 "NGN":{ 370 "money_format":"₦{{amount}}", 371 "money_with_currency_format":"₦{{amount}} NGN" 372 }, 373 "NOK":{ 374 "money_format":"kr {{amount_with_comma_separator}}", 375 "money_with_currency_format":"kr {{amount_with_comma_separator}} NOK" 376 }, 377 "OMR":{ 378 "money_format":"{{amount_with_comma_separator}} OMR", 379 "money_with_currency_format":"{{amount_with_comma_separator}} OMR" 380 }, 381 "PKR":{ 382 "money_format":"Rs.{{amount}}", 383 "money_with_currency_format":"Rs.{{amount}} PKR" 384 }, 385 "PGK":{ 386 "money_format":"K {{amount}}", 387 "money_with_currency_format":"K {{amount}} PGK" 388 }, 389 "PYG":{ 390 "money_format":"Gs. {{amount_no_decimals_with_comma_separator}}", 391 "money_with_currency_format":"Gs. {{amount_no_decimals_with_comma_separator}} PYG" 392 }, 393 "PEN":{ 394 "money_format":"S/. {{amount}}", 395 "money_with_currency_format":"S/. {{amount}} PEN" 396 }, 397 "PHP":{ 398 "money_format":"₱{{amount}}", 399 "money_with_currency_format":"₱{{amount}} PHP" 400 }, 401 "PLN":{ 402 "money_format":"{{amount_with_comma_separator}} zl", 403 "money_with_currency_format":"{{amount_with_comma_separator}} zl PLN" 404 }, 405 "QAR":{ 406 "money_format":"QAR {{amount_with_comma_separator}}", 407 "money_with_currency_format":"QAR {{amount_with_comma_separator}}" 408 }, 409 "RON":{ 410 "money_format":"{{amount_with_comma_separator}} lei", 411 "money_with_currency_format":"{{amount_with_comma_separator}} lei RON" 412 }, 413 "RUB":{ 414 "money_format":"руб{{amount_with_comma_separator}}", 415 "money_with_currency_format":"руб{{amount_with_comma_separator}} RUB" 416 }, 417 "RWF":{ 418 "money_format":"{{amount_no_decimals}} RF", 419 "money_with_currency_format":"{{amount_no_decimals}} RWF" 420 }, 421 "WST":{ 422 "money_format":"WS$ {{amount}}", 423 "money_with_currency_format":"WS$ {{amount}} WST" 424 }, 425 "SAR":{ 426 "money_format":"{{amount}} SR", 427 "money_with_currency_format":"{{amount}} SAR" 428 }, 429 "STD":{ 430 "money_format":"Db {{amount}}", 431 "money_with_currency_format":"Db {{amount}} STD" 432 }, 433 "RSD":{ 434 "money_format":"{{amount}} RSD", 435 "money_with_currency_format":"{{amount}} RSD" 436 }, 437 "SCR":{ 438 "money_format":"Rs {{amount}}", 439 "money_with_currency_format":"Rs {{amount}} SCR" 440 }, 441 "SGD":{ 442 "money_format":"${{amount}}", 443 "money_with_currency_format":"${{amount}} SGD" 444 }, 445 "SYP":{ 446 "money_format":"S£{{amount}}", 447 "money_with_currency_format":"S£{{amount}} SYP" 448 }, 449 "ZAR":{ 450 "money_format":"R {{amount}}", 451 "money_with_currency_format":"R {{amount}} ZAR" 452 }, 453 "KRW":{ 454 "money_format":"₩{{amount_no_decimals}}", 455 "money_with_currency_format":"₩{{amount_no_decimals}} KRW" 456 }, 457 "LKR":{ 458 "money_format":"Rs {{amount}}", 459 "money_with_currency_format":"Rs {{amount}} LKR" 460 }, 461 "SEK":{ 462 "money_format":"{{amount_no_decimals}} kr", 463 "money_with_currency_format":"{{amount_no_decimals}} kr SEK" 464 }, 465 "CHF":{ 466 "money_format":"SFr. {{amount}}", 467 "money_with_currency_format":"SFr. {{amount}} CHF" 468 }, 469 "TWD":{ 470 "money_format":"${{amount}}", 471 "money_with_currency_format":"${{amount}} TWD" 472 }, 473 "THB":{ 474 "money_format":"{{amount}} ฿", 475 "money_with_currency_format":"{{amount}} ฿ THB" 476 }, 477 "TZS":{ 478 "money_format":"{{amount}} TZS", 479 "money_with_currency_format":"{{amount}} TZS" 480 }, 481 "TTD":{ 482 "money_format":"${{amount}}", 483 "money_with_currency_format":"${{amount}} TTD" 484 }, 485 "TND":{ 486 "money_format":"{{amount}}", 487 "money_with_currency_format":"{{amount}} DT" 488 }, 489 "TRY":{ 490 "money_format":"{{amount}}TL", 491 "money_with_currency_format":"{{amount}}TL" 492 }, 493 "UGX":{ 494 "money_format":"Ush {{amount_no_decimals}}", 495 "money_with_currency_format":"Ush {{amount_no_decimals}} UGX" 496 }, 497 "UAH":{ 498 "money_format":"?{{amount}}", 499 "money_with_currency_format":"?{{amount}} UAH" 500 }, 501 "AED":{ 502 "money_format":"Dhs. {{amount}}", 503 "money_with_currency_format":"Dhs. {{amount}} AED" 504 }, 505 "UYU":{ 506 "money_format":"${{amount_with_comma_separator}}", 507 "money_with_currency_format":"${{amount_with_comma_separator}} UYU" 508 }, 509 "VUV":{ 510 "money_format":"${{amount}}", 511 "money_with_currency_format":"${{amount}}VT" 512 }, 513 "VEF":{ 514 "money_format":"Bs. {{amount_with_comma_separator}}", 515 "money_with_currency_format":"Bs. {{amount_with_comma_separator}} VEF" 516 }, 517 "VND":{ 518 "money_format":"{{amount_no_decimals_with_comma_separator}}₫", 519 "money_with_currency_format":"{{amount_no_decimals_with_comma_separator}} VND" 520 }, 521 "XBT":{ 522 "money_format":"{{amount_no_decimals}} BTC", 523 "money_with_currency_format":"{{amount_no_decimals}} BTC" 524 }, 525 "XOF":{ 526 "money_format":"CFA{{amount}}", 527 "money_with_currency_format":"CFA{{amount}} XOF" 528 }, 529 "ZMW":{ 530 "money_format":"K{{amount_no_decimals_with_comma_separator}}", 531 "money_with_currency_format":"ZMW{{amount_no_decimals_with_comma_separator}}" 532 } 533}; 534 535Currency.formatMoney = function(cents, format) { 536 if (typeof Shopify.formatMoney === 'function') { 537 return Shopify.formatMoney(cents, format); 538 } 539 if (typeof cents == 'string') { cents = cents.replace('.',''); } 540 var value = ''; 541 var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; 542 var formatString = format || '${{amount}}'; 543 function defaultOption(opt, def) { 544 return (typeof opt == 'undefined' ? def : opt); 545 } 546 function formatWithDelimiters(number, precision, thousands, decimal) { 547 precision = defaultOption(precision, 2); 548 thousands = defaultOption(thousands, ','); 549 decimal = defaultOption(decimal, '.'); 550 if (isNaN(number) || number == null) { return 0; } 551 number = (number/100.0).toFixed(precision); 552 var parts = number.split('.'), 553 dollars = parts[0].replace(/(\d)(?=(\
553d\d\d)+(?!\d))/g, '$1' + thousands), 554 cents = parts[1] ? (decimal + parts[1]) : ''; 555 return dollars + cents; 556 } 557 switch(formatString.match(placeholderRegex)[1]) { 558 case 'amount': 559 value = formatWithDelimiters(cents, 2); 560 break; 561 case 'amount_no_decimals': 562 value = formatWithDelimiters(cents, 0); 563 break; 564 case 'amount_with_comma_separator': 565 value = formatWithDelimiters(cents, 2, '.', ','); 566 break; 567 case 'amount_no_decimals_with_comma_separator': 568 value = formatWithDelimiters(cents, 0, '.', ','); 569 break; 570 } 571 return formatString.replace(placeholderRegex, value); 572}; 573 574Currency.currentCurrency = ''; 575 576Currency.format = 'money_with_currency_format'; 577 578Currency.convertAll = function(oldCurrency, newCurrency, selector, format) { 579 jQuery(selector || 'span.money').each(function() { 580 // If the amount has already been converted, we leave it alone. 581 if (jQuery(this).attr('data-currency') === newCurrency) return; 582 // If we are converting to a currency that we have saved, we will use the saved amount. 583 if (jQuery(this).attr('data-currency-'+newCurrency)) { 584 jQuery(this).html(jQuery(this).attr('data-currency-'+newCurrency)); 585 } 586 else { 587 // Converting to Y for the first time? Let's get to it! 588 var cents = 0.0;
589 var oldFormat = Currency.moneyFormats[oldCurrency][format || Currency.format] || '{{amount}}'; 590 var newFormat = Currency.moneyFormats[newCurrency][format || Currency.format] || '{{amount}}'; 591 if (oldFormat.indexOf('amount_no_decimals') !== -1) { 592 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10)*100, oldCurrency, newCurrency); 593 } 594 else if (oldCurrency === 'JOD' || oldCurrency == 'KWD' || oldCurrency == 'BHD') { 595 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10)/10, oldCurrency, newCurrency); 596 } 597 else { 598 cents = Currency.convert(parseInt(jQuery(this).html().replace(/[^0-9]/g, ''), 10), oldCurrency, newCurrency); 599 } 600 var newFormattedAmount = Currency.formatMoney(cents, newFormat); 601 jQuery(this).html(newFormattedAmount); 602 jQuery(this).attr('data-currency-'+newCurrency, newFormattedAmount); 603 } 604 // We record the new currency locally. 605 jQuery(this).attr('data-currency', newCurrency); 606 }); 607 this.currentCurrency = newCurrency; 608 this.cookie.write(newCurrency); 609};
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.