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
function pageLoaded() { | |
return new Promise(resolve => { | |
if (document.readyState === "complete") { | |
resolve(); | |
} else { | |
window.addEventListener("load", () => { | |
resolve(); | |
}); | |
} | |
}); |
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
const ext = url.slice(((url.lastIndexOf(".") - 1) >>> 0) + 2); |
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
export default function $(strings, ...expressions) { | |
let selector = [strings[0]]; | |
expressions.forEach((expr, i) => selector.push(expr, strings[i + 1])); | |
return document.querySelector(selector.join("")); | |
} |
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
const IEdgeMatches = /(Edge|Trident)\/(\d.)/i.exec(navigator.userAgent); | |
export default IEdgeMatches && parseInt(IEdgeMatches[2], 10) < 17; |
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
# Cross-editor coding style settings. | |
# See http://editorconfig.org/ for details. | |
root = true | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 4 | |
end_of_line = lf |
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
[#ftl] | |
[#-- @implicitly included --] | |
[#-- @ftlvariable name="content" type="info.magnolia.jcr.util.ContentMap" --] | |
[#-- @ftlvariable name="ctx" type="info.magnolia.context.MgnlContext" --] | |
[#-- @ftlvariable name="def" type="info.magnolia.rendering.template.configured.ConfiguredTemplateDefinition" --] | |
[#-- @ftlvariable name="state" type="info.magnolia.cms.core.AggregationState" --] | |
[#-- @ftlvariable name="i18n" type="info.magnolia.freemarker.MessagesWrapper" --] | |
[#-- @ftlvariable name="i18nAuthoring" type="info.magnolia.freemarker.MessagesWrapper" --] | |
[#-- @ftlvariable name="cms" type="info.magnolia.templating.freemarker.Directives" --] |
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
const def = ["en", "fr", "de"]; | |
let locale = navigator.language.indexOf("-") === -1 | |
? navigator.language | |
: navigator.language.split("-")[0]; | |
locale = def.indexOf(locale) === -1 ? def[0] : locale; | |
document.documentElement.lang = locale; |
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
# remove sound | |
ffmpeg -i input.mp4 -c copy -an output.mp4 | |
# export first frame | |
ffmpeg -i input.mp4 -ss 0 -vframes 1 poster.png | |
# Resize | |
ffmpeg -i input.mp4 -filter:v scale=-1:720 -c:a copy output.mp4 | |
ffmpeg -i input.mp4 -filter:v scale=-1:720 -c:a copy output.mp4 |
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
(function() { | |
var image = document.getElementById("image-${content.@id}"); | |
var imageTop = (function() { | |
var element = image, top = element.offsetTop; | |
while ((element = element.offsetParent) !== null && element !== document.body) { top += element.offsetTop; } | |
return top; | |
}()); | |
image.style.height = (window.innerHeight - imageTop) + "px"; | |
}()); |
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
/** | |
* External plugins added through the server-side FieldFactory are automatically registered. | |
* Other external plugins (e.g. client-only) may still be registered here (and subsequently added via config.extraPlugins). | |
* | |
* e.g. if your plugin resides in src/main/resources/VAADIN/js: | |
* CKEDITOR.plugins.addExternal("abbr", CKEDITOR.vaadinDirUrl + "js/abbr/"); | |
*/ | |
CKEDITOR.editorConfig = function ( config ) { | |
// MIRROR info.magnolia.ui.form.field.definition.RichTextFieldDefinition |