<xsl:template match="docbook:videoobject[docbook:videodata/@type = 'youtube']" priority="10">
<xsl:variable name="width" select="substring-before(docbook:videodata/@width, 'px')"/>
<xsl:variable name="height" select="substring-before(docbook:videodata/@depth, 'px')"/>
<xsl:variable name="videoId" select="docbook:videodata/@fileref"/>
<iframe id="{$videoId}" class="{../@class}" width="{$width}" height="{$height}" src="//www.youtube.com/embed/{$videoId}" frameborder="0" allowfullscreen="allowfullscreen"/>
<script type="text/javascript">
$j(window).resize(function() { var a = $j('#<xsl:value-of select="$videoId"/>'); a.css('max-height', a.attr('height')/a.attr('width')*a.width()); })
</script>
</xsl:template>
<xsl:template match="docbook:videoobject[docbook:videodata/@type = 'dailymotion']" priority="10">
<xsl:variable name="width" select="substring-before(docbook:videodata/@width, 'px')"/>
<xsl:variable name="height" select="substring-before(docbook:videodata/@depth, 'px')"/>
<xsl:variable name="videoId" select="docbook:videodata/@fileref"/>
<iframe id="{$videoId}" class="{../@class}" width="{$width}" height="{$height}" src="//www.dailymotion.com/embed/video/{$videoId}" frameborder="0" allowfullscreen="true"/>
<script type="text/javascript">
$j(window).resize(function() { var a = $j('#<xsl:value-of select="$videoId"/>'); a.css('max-height', a.attr('height')/a.attr('width')*a.width()); })
</script>
</xsl:template>
<xsl:template name="search-autocomplete">
<script type="text/javascript">
$j().ready(function()
{
function parseXML(data)
{
var results = [];
var branches = $j(data).find('item');
$j(branches).each(function() {
var text = $j.trim($j(this).text());
results[results.length] = {'data': [text, text], 'result': text, 'value': text};
});
return results;
}
$j("#search-field-<xsl:value-of select="$uniqueId"/>").autocomplete({
source: function(request, response) {
$j.ajax({ url: "<xsl:value-of select="$uri-prefix"/>/plugins/web/service/search/auto-completion/<xsl:value-of select="$site"/>/<xsl:value-of select="$lang"/>.xml?q=" + request.term,
dataType: "xml",
success: function(xmlResponse) { response(parseXML (xmlResponse)); } });
},
minLength: 2,
delay: 500
});
});
</script>
</xsl:template>
<xsl:if test="@definition='common$wording$textfield' or @definition='ContentSearchable$systemProperty$fulltextStemmed' or @definition='ContentSearchable$systemProperty$fulltext'">
<xsl:call-template name="js-autocompletion">
<xsl:with-param name="field-id" select="$id"/>
</xsl:call-template>
</xsl:if>
@{search}@{searchText}
@{replace}
java.lang.System.setProperty("nashorn.args", "--no-deprecation-warning")
var notInSkin = false;
if (ifExtends_@{id})
{
var reg1 = java.util.regex.Pattern.compile("(.*(?:/|\\\\)(?:models|skins)(?:/|\\\\)[^/\\\\]+)(?:/|\\\\).*").matcher(file.getPath());
if (reg1.matches())
{
var c = java.nio.file.Files.readString(java.nio.file.Path.of(reg1.group(1) + '/conf/skin.xml'));
var reg = java.util.regex.Pattern.compile(".*extends=\".*(?:(?<=\")|,|\\s)" + ifExtends_@{id} + "(?:(?=\")|,|\\s).*\".*", java.util.regex.Pattern.MULTILINE | java.util.regex.Pattern.DOTALL).matcher(c);
if (!reg.matches())
{
self.setSelected(false);
notInSkin = true;
}
}
else
{
self.setSelected(false);
notInSkin = true;
}
}
if (!notInSkin && !file.isDirectory())
{
try
{
var s = java.nio.file.Files.readString(java.nio.file.Path.of(file));
var r1 = search_@{id}.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\*", "\\\\*").replaceAll("\\+", "\\\\+")
.replaceAll("\\.", "\\\\.").replaceAll("\\?", "\\\\?").replaceAll("\\|", "\\\\|").replaceAll("\\[", "\\\\[")
.replaceAll("\\]", "\\\\]").replaceAll("\\(", "\\\\(").replaceAll("\\)", "\\\\)").replaceAll("\\{", "\\\\{")
.replaceAll("\\}", "\\\\}").replaceAll("\\^", "\\\\^").replaceAll("\\$", "\\\\\\$").replaceAll("\\s+", "\\\\s+");
var r2 = andSearch_@{id}.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\*", "\\\\*").replaceAll("\\+", "\\\\+")
.replaceAll("\\.", "\\\\.").replaceAll("\\?", "\\\\?").replaceAll("\\|", "\\\\|").replaceAll("\\[", "\\\\[")
.replaceAll("\\]", "\\\\]").replaceAll("\\(", "\\\\(").replaceAll("\\)", "\\\\)").replaceAll("\\{", "\\\\{")
.replaceAll("\\}", "\\\\}").replaceAll("\\^", "\\\\^").replaceAll("\\$", "\\\\\\$").replaceAll("\\s+", "\\\\s+");
var m = java.util.regex.Pattern.compile("(.*)" + r1 + "(.*)", java.util.regex.Pattern.MULTILINE | java.util.regex.Pattern.DOTALL).matcher(s);
var m2 = java.util.regex.Pattern.compile("(.*)" + r2 + "(.*)", java.util.regex.Pattern.MULTILINE | java.util.regex.Pattern.DOTALL).matcher(s);
c = m.matches() && m2.matches();
self.setSelected(c);
if (c)
{
try
{
var r3 = m.replaceAll("$1" + replace_@{id} + "$2");
java.nio.file.Files.writeString(java.nio.file.Path.of(file), r3);
if (project.getProperty("returned_@{id}") == null)
{
project.setProperty("returned_@{id}", true);
project.log("@{message}", org.apache.tools.ant.Project.MSG_WARN);
}
project.log("* " + filename, org.apache.tools.ant.Project.MSG_WARN)
}
catch (e)
{
if (project.getProperty("returned_@{id}") == null)
{
project.setProperty("returned_@{id}", true);
project.log("@{message}", org.apache.tools.ant.Project.MSG_ERROR);
}
project.log("* " + filename, org.apache.tools.ant.Project.MSG_ERROR)
}
project.log("--------------------------------------------------------------------------------------------", org.apache.tools.ant.Project.MSG_INFO)
}
} catch (e)
{
project.log("Error in file " + filename, org.apache.tools.ant.Project.MSG_ERROR)
throw e;
}
}