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 MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; | |
var container = document.querySelector('paper-dialog.ytd-popup-container'); | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
console.log(mutation); | |
if(mutation.attributeName === 'style'){ | |
if(!(container.style.display === 'none')){ | |
console.log('triggering click'); | |
var y = document.querySelector('.yt-confirm-dialog-renderer yt-formatted-string[id="text"]'); |
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 tags =$('[data-fieldname="./cq:tags"]’); | |
var tagList = CUI.Widget.fromElement(CUI.TagList,tags); | |
tagList.options.values = ['hello','world'] | |
tagList._setValues() |
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
See http://proliferay.com/create-json-by-jackson-api/ | |
ObjectMapper om = new ObjectMapper(); | |
ObjectNode objectNode = om.createObjectNode(); | |
ArrayNode arrayNode = om.createArrayNode(); |
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 | |
#setup | |
# in bash profile set an alias for goto alias='goto=. ./goto.sh' | |
# in bash profile set an alias for goback alias goback=$goback | |
# Usage: | |
# goto commonpath | |
#goto script for lazy people who dont want to have a lot of aliases or keep sourcing the bash profile | |
#Argument handling |
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
Granite.UI.Foundation.Registry.get('foundation.validation.validator'); |
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
public String[] getValuesAsStringArray(final Resource resource, final String propertyToExtract){ | |
try { | |
final Node node = resource.adaptTo(Node.class); | |
final Property property = node.getProperty(propertyToExtract); | |
final Resource childProperty = resource.getChild(propertyToExtract); | |
if(property.isMultiple() && childProperty != null){ | |
return childProperty.adaptTo(String[].class); | |
}else{ | |
return new String[]{ childProperty.adaptTo(String.class) }; | |
} |
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
<file | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/form/fileupload" | |
autoStart="{Boolean}false" | |
class="cq-droptarget" | |
fieldLabel="Image asset" | |
fileNameParameter="./image/fileName" | |
fileReferenceParameter="./image/fileReference" | |
mimeTypes="[image]" | |
multiple="{Boolean}false" |
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
Coral.commons.ready(function () { | |
try{ | |
var $element = $('[data-target="touchui-reviewer-group-target"]'); | |
if($element && $element.length > 0){ | |
var jsonResponse = Granite.HTTP.eval('sampleUrl'); | |
var select = CUI.Widget.fromElement(CUI.Select,$element); | |
var selectList = CUI.Widget.fromElement(CUI.SelectList,select._selectList); | |
jsonResponse.forEach(function(json) { | |
var text = json.text; | |
selectList.addOption({ |
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
Querybuilder Debugger Tool | |
http://localhost:4502/libs/cq/search/content/querydebug.html | |
Standard Search based on brand | |
fulltext=something | |
1_group.p.or=true | |
1_group.1_type=cq:Page | |
1_group.2_type=dam:Asset | |
2_group.p.or=true | |
2_group.1_path=/content/brand | |
2_group.2_path=/content/dam/branch |
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 | |
# Add to .bash_profile: alias pushit='. /locationtofile/pushit.sh' | |
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
echo "pushing to branch $CURRENT_BRANCH" | |
git push origin $CURRENT_BRANCH |