This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// appends the parameter with the given name and | |
// value to the given url and returns the changed url | |
appendParamToURL: function(url, name, value) { | |
var c = "?"; | |
if (url.indexOf(c) != -1) { | |
c = "&"; | |
} | |
return url + c + name + "=" + encodeURIComponent(value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disables browser auto completion for the given element | |
disableAutoComplete: function(selector) { | |
jQuery(selector).attr("autocomplete", "off"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inventory = Product.getAvailabilityModel().getInventoryRecord().ATS.value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<isscript> | |
var data = {}; | |
data.success = pdict.GeneralError == null ? true : false; | |
data.result = { | |
lineItemId: pdict.GiftCertificateLineItem.UUID, | |
amount: pdict.GiftCertificateLineItem.baseValue | |
}; | |
data.errors = {}; | |
</isscript> | |
<isprint value="${JSON.stringify( data )}" encoding="off"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
hovertable(); | |
}); | |
function hovertable(){ | |
jQuery("table.hovertable").delegate('td','mouseover mouseleave', function(e) { | |
if (e.type == 'mouseover') { | |
jQuery(this).addClass("hover"); | |
jQuery(this).parent().addClass("hover-row"); | |
jQuery(this).parents("table").find("colgroup").eq(jQuery(this).index()).addClass("hover-column"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Show updated mini-cart using data returned from the add to cart submission | |
function updateMiniCart(data){ | |
jQuery.ajax({ | |
type: 'POST', | |
url: serverData.showMiniCartUrl, | |
data: {lineItemId: data.result.lineItemId}, | |
cache: false, | |
success: function(html){ | |
app.minicart.show(html); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlParam(key){ | |
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
return result && result[1] || ""; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getShortDescription(product : Product) { | |
var description : String = product.getLongDescription().toString(); | |
var htmlTest : RegExp = new RegExp("(<([^>]+)>)", "ig"); | |
description = description.replace(htmlTest, ""); | |
return description; | |
} |