FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptButtons/dist/paypal-button-minicart.min.js at 0.9 · webgoon/JavaScriptButtons · GitHub
webgoon
JavaScriptButtons
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptButtons
/
dist
/
paypal-button-minicart.min.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
7 lines (7 loc) · 22.9 KB
Breadcrumbs
JavaScriptButtons
/
dist
/
paypal-button-minicart.min.js
Copy path
File metadata and controls
7 lines (7 loc) · 22.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
/*!
* PayPalJSButtons
* JavaScript integration for PayPal's payment buttons
*
@version
1.0.0 - 2012-11-15, 4:07:00 PM
*
@author
Jeff Harrell <https://github.com/jeffharrell/>
*/
if
(
typeof
PAYPAL
==
"undefined"
||
!
PAYPAL
)
var
PAYPAL
=
{
}
;
PAYPAL
.
apps
=
PAYPAL
.
apps
||
{
}
,
function
(
)
{
"use strict"
;
var
config
=
{
parent
:
document
.
body
,
displayEdge
:
"right"
,
edgeDistance
:
"50px"
,
formTarget
:
null
,
cookiePath
:
"/"
,
strings
:
{
button
:
""
,
subtotal
:
""
,
discount
:
""
,
shipping
:
""
,
processing
:
""
}
,
name
:
"PPMiniCart"
,
peekEnabled
:
!
0
,
paypalURL
:
"https://www.paypal.com/cgi-bin/webscr"
,
assetURL
:
"http://www.minicartjs.com/build/"
,
events
:
{
onRender
:
null
,
afterRender
:
null
,
onHide
:
null
,
afterHide
:
null
,
onShow
:
null
,
afterShow
:
null
,
onAddToCart
:
null
,
afterAddToCart
:
null
,
onRemoveFromCart
:
null
,
afterRemoveFromCart
:
null
,
onCheckout
:
null
,
onReset
:
null
,
afterReset
:
null
}
}
;
PAYPAL
.
apps
.
MiniCart
=
function
(
)
{
var
e
=
{
}
,
t
=
!
1
,
n
=
!
1
,
r
=
{
_cart
:
!
0
,
_xclick
:
!
0
}
,
i
=
"MiniCart_AddToCart_WPS_US"
,
s
=
/
^
(?:
b
u
s
i
n
e
s
s
|
c
u
r
r
e
n
c
y
_
c
o
d
e
|
l
c
|
p
a
y
m
e
n
t
a
c
t
i
o
n
|
n
o
_
s
h
i
p
p
i
n
g
|
c
n
|
n
o
_
n
o
t
e
|
i
n
v
o
i
c
e
|
h
a
n
d
l
i
n
g
_
c
a
r
t
|
w
e
i
g
h
t
_
c
a
r
t
|
w
e
i
g
h
t
_
u
n
i
t
|
t
a
x
_
c
a
r
t
|
p
a
g
e
_
s
t
y
l
e
|
i
m
a
g
e
_
u
r
l
|
c
p
p
_
|
c
s
|
c
b
t
|
r
e
t
u
r
n
|
c
a
n
c
e
l
_
r
e
t
u
r
n
|
n
o
t
i
f
y
_
u
r
l
|
r
m
|
c
u
s
t
o
m
|
c
h
a
r
s
e
t
)
/
,
o
=
function
(
)
{
var
e
=
config
.
name
,
t
=
[
]
,
n
,
r
;
t
.
push
(
"#"
+
e
+
" form { position:fixed; float:none; top:-250px; "
+
config
.
displayEdge
+
":"
+
config
.
edgeDistance
+
"; width:265px; margin:0; padding:50px 10px 0; min-height:170px; background:#fff url("
+
config
.
assetURL
+
"images/minicart_sprite.png) no-repeat -125px -60px; border:1px solid #999; border-top:0; font:13px/normal arial, helvetica; color:#333; text-align:left; -moz-border-radius:0 0 8px 8px; -webkit-border-radius:0 0 8px 8px; border-radius:0 0 8px 8px; -moz-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1); box-shadow:1px 1px 1px rgba(0, 0, 0, 0.1); } "
)
,
t
.
push
(
"#"
+
e
+
" ul { position:relative; overflow-x:hidden; overflow-y:auto; height:130px; margin:0 0 7px; padding:0; list-style-type:none; border-top:1px solid #ccc; border-bottom:1px solid #ccc; } "
)
,
t
.
push
(
"#"
+
e
+
" li { position:relative; margin:-1px 0 0; padding:6px 5px 6px 0; border-top:1px solid #f2f2f2; } "
)
,
t
.
push
(
"#"
+
e
+
" li a { display: block; width: 155px; color:#333; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } "
)
,
t
.
push
(
"#"
+
e
+
" li a span { color:#999; font-size:10px; } "
)
,
t
.
push
(
"#"
+
e
+
" li .quantity { position:absolute; top:.5em; right:78px; width:22px; padding:1px; border:1px solid #83a8cc; text-align:right; } "
)
,
t
.
push
(
"#"
+
e
+
" li .price { position:absolute; top:.5em; right:4px; } "
)
,
t
.
push
(
"#"
+
e
+
" li .remove { position:absolute; top:9px; right:60px; width:14px; height:14px; background:url("
+
config
.
assetURL
+
"images/minicart_sprite.png) no-repeat -134px -4px; border:0; cursor:pointer; } "
)
,
t
.
push
(
"#"
+
e
+
" p { margin:0; padding:0 0 0 20px; background:url("
+
config
.
assetURL
+
"images/minicart_sprite.png) no-repeat; font-size:13px; font-weight:bold; } "
)
,
t
.
push
(
"#"
+
e
+
" p:hover { cursor:pointer; } "
)
,
t
.
push
(
"#"
+
e
+
" p input { float:right; margin:4px 0 0; padding:1px 4px; text-decoration:none; font-weight:normal; color:#333; background:#ffa822 url("
+
config
.
assetURL
+
"images/minicart_sprite.png) repeat-x left center; border:1px solid #d5bd98; border-right-color:#935e0d; border-bottom-color:#935e0d; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; } "
)
,
t
.
push
(
"#"
+
e
+
" p .shipping { display:block; font-size:10px; font-weight:normal; color:#999; } "
)
,
n
=
document
.
createElement
(
"style"
)
,
n
.
type
=
"text/css"
,
n
.
styleSheet
?
n
.
styleSheet
.
cssText
=
t
.
join
(
""
)
:
n
.
appendChild
(
document
.
createTextNode
(
t
.
join
(
""
)
)
)
,
r
=
document
.
getElementsByTagName
(
"head"
)
[
0
]
,
r
.
appendChild
(
n
)
}
,
u
=
function
(
)
{
var
t
=
e
.
UI
,
n
,
r
,
s
,
o
,
u
;
t
.
wrapper
=
document
.
createElement
(
"div"
)
,
t
.
wrapper
.
id
=
config
.
name
,
n
=
document
.
createElement
(
"input"
)
,
n
.
type
=
"hidden"
,
n
.
name
=
"cmd"
,
n
.
value
=
"_cart"
,
r
=
n
.
cloneNode
(
!
1
)
,
r
.
name
=
"upload"
,
r
.
value
=
"1"
,
s
=
n
.
cloneNode
(
!
1
)
,
s
.
name
=
"bn"
,
s
.
value
=
i
,
t
.
cart
=
document
.
createElement
(
"form"
)
,
t
.
cart
.
method
=
"post"
,
t
.
cart
.
action
=
config
.
paypalURL
,
config
.
formTarget
&&
(
t
.
cart
.
target
=
config
.
formTarget
)
,
t
.
cart
.
appendChild
(
n
)
,
t
.
cart
.
appendChild
(
r
)
,
t
.
cart
.
appendChild
(
s
)
,
t
.
wrapper
.
appendChild
(
t
.
cart
)
,
t
.
itemList
=
document
.
createElement
(
"ul"
)
,
t
.
cart
.
appendChild
(
t
.
itemList
)
,
t
.
summary
=
document
.
createElement
(
"p"
)
,
t
.
cart
.
appendChild
(
t
.
summary
)
,
t
.
button
=
document
.
createElement
(
"input"
)
,
t
.
button
.
type
=
"submit"
,
t
.
button
.
value
=
config
.
strings
.
button
||
"Checkout"
,
t
.
summary
.
appendChild
(
t
.
button
)
,
t
.
subtotal
=
document
.
createElement
(
"span"
)
,
t
.
subtotal
.
innerHTML
=
config
.
strings
.
subtotal
||
"Subtotal: "
,
t
.
subtotalAmount
=
document
.
createElement
(
"span"
)
,
t
.
subtotalAmount
.
innerHTML
=
"0.00"
,
t
.
subtotal
.
appendChild
(
t
.
subtotalAmount
)
,
t
.
summary
.
appendChild
(
t
.
subtotal
)
,
t
.
shipping
=
document
.
createElement
(
"span"
)
,
t
.shipping.className="shipping",t.shipping.innerHTML=config.strings.shipping||"does not include shipping & tax",t.summary.appendChild(t.shipping);if(window.attachEvent&&!window.opera){u=navigator.userAgent.match(/MSIE\s([^;]*)/);if(u){u=parseFloat(u[1]);if(u<7||u>=7&&document.compatMode==="BackCompat")t.cart.style.position="absolute",t.wrapper.style[config.displayEdge]="0",t.wrapper.style.setExpression("top","x = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop")}}o=typeof config.parent=="string"?document.getElementById(config.parent):config.parent,o.appendChild(t.wrapper)},a=function(){var n=e.UI,i,s,o;i=document.getElementsByTagName("form");for(o=0;o<i.length;o++)s=i[o],s.cmd&&r[s.cmd.value]&&e.bindForm(s);$.event.add(document,"click",function(r){if(t){var i=r.target,s=n.cart;if(!/input|button|select|option/i.test(i.tagName)){while(i.nodeType===1){if(i===s)return;i=i.parentNode}e.hide(null)}}}),$.event.add(n.cart,"submit",function(e){m(e)}),$.event.add(n.summary,"click",function(t){var r=t.target;r!==n.button&&e.toggle(t)}),window.attachEvent&&!window.opera?$.event.add(document,"storage",function(e){setTimeout(p,100)}):$.event.add(window,"storage",function(e){(e.key&&e.key===config.name||!e.key)&&p()})},f=function(e){var t;for(t in e)typeof config[t]!==undefined&&(config[t]=e[t])},l=function(){var e,n,r;if(e=$.storage.load()){n=e.length;for(r=0;r<n;r++)d(e[r])&&(t=!0)}},c=function(e){var t=e.elements,n={},r,i,s,o;for(s=0,o=t.length;s<o;s++){r=t[s];if(i=$.util.getInputValue(r))n[r.name]=i}return n},h=function(t){var n={},r={},i,o,u,a,f,l,c;for(u in t)s.test(u)?r[u]=t[u]:n[u]=t[u];for(l=0,a=e.products.length;l<a;l++){i=e.products[l].product;if(n.item_name===i.item_name&&n.item_number===i.item_number){f=!0,c=0;while(i["os"+c]){if(n["os"+c]!==i["os"+c]){f=!1;break}c++}if(f){n.offset=i.offset;break}}}n.href=n.href||window.location.href,n.quantity=n.quantity||1,n.amount=n.amount||0,r["return"]&&r["return"].indexOf("#")===-1&&(r["return"]+="#"+config.name+"=reset"),o=n.option_index?n.option_index:0;while(n["os"+o]){l=0;while(typeof n["option_select"+l]!="undefined"){if(n["option_select"+l]===n["os"+o]){n.amount=n.amount+parseFloat(n["option_amount"+l]);break}l++}o++}return{product:n,settings:r}},p=function(){e.products=[],e.UI.itemList.innerHTML="",e.UI.subtotalAmount.innerHTML="",l(),e.updateSubtotal()},d=function(t){var n=e.UI,r=n.cart,i=new ProductNode(t,e.UI.itemList.children.length+1),s=t.product.offset,o,u,a;e.products[s]=i;for(a in t.settings)r.elements[a]?r.elements[a].value?r.elements[a].value=t.settings[a]:r.elements[a]=t.settings[a]:(u=document.createElement("input"),u.type="hidden",u.name=a,u.value=t.settings[a],r.appendChild(u));if(i.isPlaceholder)return!1;$.event.add(i.removeInput,"click",function(){v(i,s)});var f=i.quantityInput.value;return $.event.add(i.quantityInput,"keyup",function(){var t=this;o=setTimeout(function(){var n=parseInt(t.value,10);!isNaN(n)&&n!==f&&(f=n,i.setQuantity(n),i.getQuantity()||v(i,s),e.updateSubtotal(),$.storage.save(e.products))},250)}),n.itemList.insertBefore(i.liNode,n.itemList.firstChild),$.util.animate(i.liNode,"opacity",{from:0,to:1}),!0},v=function(t,n){var r=config.events,i=r.onRemoveFromCart,s=r.afterRemoveFromCart;if(typeof i=="function"&&i.call(e,t)===!1)return;t.setQuantity(0),t.quantityInput.style.display="none",$.util.animate(t.liNode,"opacity",{from:1,to:0},function(){$.util.animate(t.liNode,"height",{from:18,to:0},function(){try{t.liNode.parentNode.removeChild(t.liNode)}catch(n){}var r=e.UI.cart.getElementsByTagName("li"),i=r.length,o,u,a,f,l,c,h=1;for(l=0;l<i;l++){o=r[l].getElementsByTagName("input"),u=o.length;for(c=0;c<u;c++)a=o[c],f=/(.+)_[0-9]+$/.exec(a.name),f&&f[1]&&(a.name=f[1]+"_"+h);h++}typeof s=="function"&&s.call(e,t)})}),e.products[n].product.item_name="",e.products[n].product.item_number="",e.updateSubtotal(),$.storage.save(e.products)},m=function(t){var n=config.events.onCheckout;if(typeof n=="function"&&n.call(e,t)===!1){t.preventDefault();return}e.UI.button.value=config.strings.processing||"Processing..."};return e.products=[],e.UI={},e.render=function(r){var i=config.events,s=i.onRender,l=i.afterRender,c,h;if(typeof s=="function"&&s.call(e)===!1)return;n||(f(r),o(),u(),a(),c=location.hash.substring(1),c.indexOf(config.name+"=")===0&&(h=c.split("=")[1],h==="reset"&&(e.reset(),location.hash=""))),p(),n||(t?setTimeout(function(){e.hide(null)},500):$.storage.remove()),n=!0,typeof l=="function"&&l.call(e)},e.bindForm=function(t){if(t.add)$.event.add(t,"submit",function(t){t.preventDefault(t);var n=c(t.target);e.addToCart(n)});else{if(!t.display)return!1;$.event.add(t,"submit",function(t){t.preventDefault(),e.show(t)})}return!0},e.addToCart=function(t){var n=config.events,r=n.onAddToCart,i=n.afterAddToCart,s=!1,o,u;t=h(t),u=t.product.offset;if(typeof r=="function"&&r.call(e,t.product)===!1)return;return(o=this.getProductAtOffset(u))?(o.product.quantity+=parseInt(t.product.quantity||1,10),o.setPrice(t.product.amount*o.product.quantity),o.setQuantity(o.product.quantity),s=!0):(t.product.offset=e.products.length,s=d(t)),e.updateSubtotal(),e.show(null),$.storage.save(e.products),typeof i=="function"&&i.call(e,t),s},e.getProductAtOffset=function(e){return typeof e!="undefined"&&this.products[e]},e.calculateSubtotal=function(){var t=0,n=e.products,r,i,s,o,u,a;for(a=0,u=n.length;a<u;a++)i=n[a],(r=i.product)&&r.quantity&&r.amount&&(s=r.amount,o=i.getDiscount(),t+=parseFloat(s*r.quantity-o));return t.toFixed(2)},e.updateSubtotal=function(){var t=e.UI,n=t.cart.elements,r=t.subtotalAmount,i=e.calculateSubtotal(),s=1,o,u,a,f,l;o="",u="";if(n.currency_code)o=n.currency_code.value||n.currency_code;else for(l=0,f=n.length;l<f;l++)if(n[l].name==="currency_code"){o=n[l].value||n[l];break}r.innerHTML=$.util.formatCurrency(i,o),function c(){a=s.toString(16),s++,r.style.backgroundColor="#ff"+a;if(s>=15){r.style.backgroundColor="transparent",i==="0.00"&&e.hide(null,!0);return}setTimeout(c,30)}()},e.show=function(n){var r=parseInt(e.UI.cart.offsetTop,10),i=0,s=config.events,o=s.onShow,u=s.afterShow;n&&n.preventDefault&&n.preventDefault();if(typeof o=="function"&&o.call(e,n)===!1)return;$.util.animate(e.UI.cart,"top",{from:r,to:i},function(){typeof u=="function"&&u.call(e,n)}),e.UI.summary.style.backgroundPosition="-195px 2px",t=!0},e.hide=function(n,r){var i=e.UI,s=i.cart,o=i.summary,u=s.offsetHeight?s.offsetHeight:document.defaultView.getComputedStyle(s,"").getPropertyValue("height"),a=o.offsetHeight?o.offsetHeight:document.defaultView.getComputedStyle(o,"").getPropertyValue("height"),f=parseInt(s.offsetTop,10),l=config.events,c=l.onHide,h=l.afterHide,p;r||e.products.length===0||!config.peekEnabled?p=u*-1:p=(u-a-8)*-1,n&&n.preventDefault&&n.preventDefault();if(typeof c=="function"&&c.call(e,n)===!1)return;$.util.animate(s,"top",{from:f,to:p},function(){typeof h=="function"&&h.call(e,n)}),o.style.backgroundPosition="-195px -32px",t=!1},e.toggle=function(n){t?e.hide(n):e.show(n)},e.reset=function(){var n=e.UI,r=config.events,i=r.onReset,s=r.afterReset;if(typeof i=="function"&&i.call(e)===!1)return;e.products=[],t&&(n.itemList.innerHTML="",n.subtotalAmount.innerHTML="",e.hide(null,!0)),$.storage.remove(),typeof s=="function"&&s.call(e)},e}();var ProductNode=function(e,t){this._view(e,t)};ProductNode.prototype={_view:function(e,t){var n,r,i,s,o,u,a;this.product=e.product,this.settings=e.settings,this.liNode=document.createElement("li"),this.nameNode=document.createElement("a"),this.metaNode=document.createElement("span"),this.discountNode=document.createElement("span"),this.discountInput=document.createElement("input"),this.priceNode=document.createElement("span"),this.quantityInput=document.createElement("input"),this.removeInput=document.createElement("input");if(!this.product||!this.product.item_name&&!this.product.item_number){this.isPlaceholder=!0;return}this.product.item_name&&(n=this.product.item_name),this.nameNode.innerHTML=n,this.nameNode.title=n,this.nameNode.href=this.product.href,this.nameNode.appendChild(this.metaNode),this.product.item_number&&(this.metaNode.innerHTML="<br />#"+this.product.item_number),o=this.getOptions();for(a in o)this.metaNode.innerHTML+="<br />"+a+": "+o[a];s=this.getDiscount(),this.discountInput.type="hidden",this.discountInput.name="discount_amount_"+t,this.discountInput.value=s,this.metaNode.appendChild(this.discountNode),r=this.getPrice(),this.priceNode.className="price",i=this.getQuantity(),this.quantityInput.name="quantity_"+t,this.quantityInput.className="quantity",this.quantityInput.setAttribute("autocomplete","off"),this.setQuantity(i),this.removeInput.type="button",this.removeInput.className="remove",this.liNode.appendChild(this.nameNode),this.liNode.appendChild(this.quantityInput),this.liNode.appendChild(this.discountInput),this.liNode.appendChild(this.removeInput),this.liNode.appendChild(this.priceNode);for(a in this.product)a!=="quantity"&&a.indexOf("discount_")===-1&&(u=document.createElement("input"),u.type="hidden",u.name=a+"_"+t,u.value=this.product[a],this.liNode.appendChild(u))},getDiscount:function(){var e=0,t=this.product.discount_num||-1,n;return this.product.discount_amount?(e=parseFloat(this.product.discount_amount),this.product.discount_amount2&&(n=this.getQuantity(),n>1&&(e+=Math.max(n-1,t)*parseFloat(this.product.discount_amount2)))):this.product.discount_rate&&(e=this.product.amount*parseFloat(this.product.discount_rate)/100,this.product.discount_rate2&&(n=this.getQuantity(),n>1&&(e+=Math.max(n-1,t)*this.product.amount*parseFloat(this.product.discount_amount2)/100))),e&&e.toFixed(2)},getOptions:function(){var e={},t=0;while(typeof this.product["on"+t]!="undefined")e[this.product["on"+t]]=this.product["os"+t],t++;return e},setQuantity:function(e){var t;e=parseInt(e,10),this.product.quantity=e;if(this.quantityInput.value!==e){this.quantityInput.value=e;if(t=this.getDiscount())this.discountInput.value=t,this.discountNode.innerHTML="<br />",this.discountNode.innerHTML+=config.strings.discount||"Discount: ",this.discountNode.innerHTML+=$.util.formatCurrency(t,this.settings.currency_code)}this.setPrice(this.product.amount*e)},getQuantity:function(){return typeof this.product.quantity!==undefined?this.product.quantity:1},setPrice:function(e){e=parseFloat(e,10),this.priceNode.innerHTML=$.util.formatCurrency(e.toFixed(2),this.settings.currency_code)},getPrice:function(){return(this.product.amount*this.getQuantity()).toFixed(2)}};var $={};$.storage=function(){var e=config.name;return window.localStorage?{load:function(){var t=localStorage.getItem(e);return t&&(t=JSON.parse(decodeURIComponent(t))),t},save:function(t){var n=[],r,i,s;if(t){for(s=0,i=t.length;s<i;s++)r=t[s],n.push({product:r.product,settings:r.settings});n=encodeURIComponent(JSON.stringify(n)),localStorage.setItem(e,n)}},remove:function(){localStorage.removeItem(e)}}:{load:function(){var t=e+"=",n,r,i,s,o;try{r=document.cookie.split(";");for(o=0;o<r.length;o++){i=r[o];while(i.charAt(0)===" ")i=i.substring(1,i.length);i.indexOf(t)===0&&(s=i.substring(t.length,i.length),n=JSON.parse(decodeURIComponent(s)))}}catch(u){}return n},save:function(e,t){var n=new Date,r=[],i,s,o;if(e){for(o=0,s=e.length;o<s;o++)i=e[o],r.push({product:i.product,settings:i.settings});t=t||30,n.setTime(n.getTime()+t*24*60*60*1e3),document.cookie=config.name+"="+encodeURIComponent(JSON.stringify(r))+"; expires="+n.toGMTString()+"; path="+config.cookiePath}},remove:function(){this.save(null,-1)}}}(),$.event=function(){var e=[];if(document.addEventListener)return{add:function(t,n,r,i){i=i||t;var s=function(e){r.call(i,e)};t.addEventListener(n,s,!1),e.push([t,n,r,s])},remove:function(t,n,r){var i,s,o=e.length,u;for(u=0;u<o;u++)s=e[u],s[0]===t&&s[1]===n&&s[2]===r&&(i=s[3],i&&(t.removeEventListener(n,i,!1),delete e[u]))}};if(document.attachEvent)return{add:function(t,n,r,i){i=i||t;var s=function(){var e=window.event;e.target=e.target||e.srcElement,e.preventDefault=function(){e.returnValue=!1},r.call(i,e)};t.attachEvent("on"+n,s),e.push([t,n,r,s])},remove:function(t,n,r){var i,s,o=e.length,u;for(u=0;u<o;u++)s=e[u],s[0]===t&&s[1]===n&&s[2]===r&&(i=s[3],i&&(t.detachEvent("on"+n,i),delete e[u]))}}}(),$.util={animate:function(e,t,n,r){n=n||{},n.from=n.from||0,n.to=n.to||0,n.duration=n.duration||10,n.unit=/top|bottom|left|right|width|height/.test(t)?"px":"";var i=(n.to-n.from)/20,s=n.from;(function o(){e.style[t]=s+n.unit,s+=i;if(i>0&&s>n.to||i<0&&s<n.to||i===0){e.style[t]=n.to+n.unit,typeof r=="function"&&r();return}setTimeout(o,n.duration)})()},getInputValue:function(e){var t=e.tagName.toLowerCase();return t==="select"?e.options[e.selectedIndex].value:t==="textarea"?e.innerHTML:e.type==="radio"?e.checked?e.value:null:e.type==="checkbox"?e.checked?e.value:null:e.value},formatCurrency:function(e,t){var n={AED:{before:"ج"},ANG:{before:"ƒ"},ARS:{before:"$"},AUD:{before:"$"},AWG:{before:"ƒ"},BBD:{before:"$"},BGN:{before:"лв"},BMD:{before:"$"},BND:{before:"$"},BRL:{before:"R$"},BSD:{before:"$"},CAD:{before:"$"},CHF:{before:""},CLP:{before:"$"},CNY:{before:"¥"},COP:{before:"$"},CRC:{before:"₡"},CZK:{before:"Kc"},DKK:{before:"kr"},DOP:{before:"$"},EEK:{before:"kr"},EUR:{before:"€"},GBP:{before:"£"},GTQ:{before:"Q"},HKD:{before:"$"},HRK:{before:"kn"},HUF:{before:"Ft"},IDR:{before:"Rp"},ILS:{before:"₪"},INR:{before:"Rs."},ISK:{before:"kr"},JMD:{before:"J$"},JPY:{before:"¥"},KRW:{before:"₩"},KYD:{before:"$"},LTL:{before:"Lt"},LVL:{before:"Ls"},MXN:{before:"$"},MYR:{before:"RM"},NOK:{before:"kr"},NZD:{before:"$"},PEN:{before:"S/"},PHP:{before:"Php"},PLN:{before:"z"},QAR:{before:"﷼"},RON:{before:"lei"},RUB:{before:"руб"},SAR:{before:"﷼"},SEK:{before:"kr"},SGD:{before:"$"},THB:{before:"฿"},TRY:{before:"TL"},TTD:{before:"TT$"},TWD:{before:"NT$"},UAH:{before:"₴"},USD:{before:"$"},UYU:{before:"$U"},VEF:{before:"Bs"},VND:{before:"₫"},XCD:{before:"$"},ZAR:{before:"R"}},r=n[t]||{},i=r.before||"",s=r.after||"";return i+e+s}};var JSON;JSON||(JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()}();if(typeof PAYPAL=="undefined"||!PAYPAL)var PAYPAL={};PAYPAL.apps=PAYPAL.apps||{},function(){"use strict";function i(e,n){var r=document.createElement("form"),i=document.createElement("input"),s=document.createElement("input"),u,a;i.type="image",s.type="hidden",r.method="post",r.action=t,r.appendChild(i),i.src=o(e);for(a in n)u=s.cloneNode(!0),u.name=a,u.value=n[a],r.appendChild(u);if(PAYPAL.apps.MiniCart&&n.cmd==="_cart"){var f=PAYPAL.apps.MiniCart;f.UI.itemList||f.render(),f.bindForm(r)}return r}function s(e){var n=document.createElement("img"),r=e.size||250,i=t+"?",s=13,o;for(o in e)i+=o+"="+e[o]+"&";return i=encodeURIComponent(i),n.src="https://www.paypal.com/webapps/ppint/qrcode?data="+i+"&pattern="+s+"&"+i+"&height="+r,n}function o(e){return r[e]||r.basic}function u(e){var t=e.dataset,n,r,i,s,o;if(!t){t={};if(n=e.attributes)for(o=0,s=n.length;o<s;o++){r=n[o];if(i=/^data-(.+)/.exec(r.name))t[i[1]]=r.value}}return t}var e={},t="https://www.paypal.com/cgi-bin/webscr",n={id:"hosted_button_id",name:"item_name",number:"item_number"},r={buynow:"//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif",cart:"//www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif",basic:"//www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"};PAYPAL.apps.ButtonFactory||(e.buttons={buy:0,cart:0,qr:0,api:0},e.create=function(e,t,r){var o={},u,a;if(!e||!e.business)return!1;for(a in e)o[n[a]||a]=e[a];return o.hosted_button_id?o.cmd="_s-xclick":t==="cart"?(o.cmd="_cart",o.add=!0):o.cmd="_xclick",t==="qr"?u=s(o):u=i(t,o),this.buttons[t]+=1,r&&r.appendChild(u),u},PAYPAL.apps.ButtonFactory=e);if(typeof document!="undefined"){var a=PAYPAL.apps.ButtonFactory,f=document.getElementsByTagName("script"),l,c,h,p,d,v;for(d=0,v=f.length;d<v;d++)l=f[d],c=l&&u(l),h=c&&c.button,p=c.business=l.src.split("?merchant=")[1],h&&p&&(a.create(c,h,l.parentNode),l.parentNode.removeChild(l))}}();
Back
|
FazBrowse Home
|
New Git URL