This file contains 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
'use strict'; | |
module.exports.init = function (editor) { | |
// Add in localization or server side processing here if you need it | |
}; |
This file contains 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
import Vue from 'vue' | |
import GraphEdge from '../data/graph/GraphEdge' | |
import GraphVertex from '../data/graph/GraphVertex' | |
export default { | |
namespaced: true, | |
state: { | |
vertices: {}, | |
edges: {}, |
This file contains 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
<template> | |
<div> | |
<h1>Data Structure Vuex in Vue</h1> | |
<br/> | |
<br/> | |
<button @click="runMacro">Run Macro</button> | |
<br/> | |
<br/> | |
<br/> |
This file contains 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
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
This file contains 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
$('html, body').animate({ | |
scrollTop: $("#elementID").offset().top | |
}, 2000); |
This file contains 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
// returns a formatted string of the sale price in USD or an empty string if there is no sale price | |
function getSalePrice(product : Product) { | |
var priceTable : ProductPriceModel = product.getPriceModel(); | |
var currentPrice : Money = priceTable.getPrice(); | |
var standardPrice : Money = priceTable.getPriceBookPrice(dw.system.Site.getCurrent().getCustomPreferenceValue('listPriceDefault')); | |
if(standardPrice.available && currentPrice.available && standardPrice.compareTo(currentPrice) == 1){ | |
// Product is on sale | |
return currentPrice.toNumberString() === "N/A" ? "" : currentPrice.toNumberString(); | |
} else { | |
// Product is not on sale |
This file contains 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 imgFile : dw.io.File = dw.io.File('/Catalogs/'+catalogId+'/default/' +imagelocation); | |
var imgFileExists : Boolean = imgFile.exists(); | |
//OR | |
var img = File('/LIBRARIES/Sitename/default/images/'+mycustomobject.custom.name); | |
if (!img.exists()) // replace this image url with a default one; |
This file contains 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 sizeChartID = null; | |
var category = pdict.Product.primaryCategory; | |
while (category !== null && sizeChartID === null) { | |
if (('sizeChartID' in category.custom) && !empty(category.custom.sizeChartID)) { | |
sizeChartID = category.custom.sizeChartID; | |
} | |
else { | |
category = category.parent; | |
} |
This file contains 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
//Returns the value of the URL parameter input key | |
urlParam: function(key){ | |
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
return result && result[1] || ""; | |
}, |
NewerOlder