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
#!/usr/bin/env bash | |
#################################################### | |
# Script to get the SiteVision version of a URL. | |
# This depends on the linked assets having the | |
# version number in their URLs. | |
#################################################### | |
if [ -z "$1" ]; then | |
echo "Missing argument (URL)" |
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
#!/usr/bin/env bash | |
#################################################### | |
# Script to download a dummy/placeholder image. | |
#################################################### | |
if [ -z "$1" ]; then | |
echo "Missing argument with the pixel dimensions (try 'dummy 250x200')" | |
exit 1 | |
fi |
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
/** | |
* [MODULE NAME] | |
* | |
* Limepark AB, 2016 | |
*/ | |
(function (window, document, $) { | |
// ... | |
// Document Ready |
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
#set( $propertyUtil = $sitevisionUtils.propertyUtil ) | |
#set( $currentPage = $sitevisionUtils.portletContextUtil.currentPage ) | |
#set( $metadataValue = $propertyUtil.getString($currentPage, 'META', '') ) | |
#if( "$!metadataValue" != "" ) | |
+metadata.META:"$metadataValue" | |
#end |
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
// Get query parameters as literal object. | |
var queryObject = (function (queryParams, k, v) { | |
return queryParams.reduce(function (params, p) { | |
if ((p = p.split('=')).length) { | |
k = p[0]; | |
v = p[0]; | |
params[k] = (typeof params[k] !== 'undefined') ? (Array.isArray(params[k]) ? params[k] : [params[k]]).concat(v) : v; | |
} | |
return params; | |
}, {}); |
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
## | |
## Utility API | |
#set ($outputUtil = $sitevisionUtils.outputUtil) | |
#set ($portletContextUtil = $sitevisionUtils.portletContextUtil) | |
#set ($resourceLocatorUtil = $sitevisionUtils.resourceLocatorUtil) | |
#set ($scriptUtil = $sitevisionUtils.scriptUtil) | |
#set ($docTypeUtil = $sitevisionUtils.docTypeUtil) | |
## | |
## Portlet properties |
OlderNewer