Commit 04b3fbfe authored by Nyashes's avatar Nyashes

ajout de la barre de recherche & bugfix

parent f11dc640
{
"url" : "http://localhost:28017/test",
"collection" : "nf29"
}
\ No newline at end of file
var config = {"url" : "http://localhost:28017/test","collection" : "nf29"}
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<head> <head>
<title>page principale</title> <title>page principale</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js" ></script> <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js" ></script>
<script type="text/javascript" src="config.jsonp"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery("document").ready(function () { function request() {
$.getJSON('config.json', function (config) {
$.ajax({ $.ajax({
url: config.url + "/" + config.collection + "/", url: config.url + "/" + config.collection + "/?" + decodeURI(document.location.href.split('#')[1]),
type: 'get', type: 'get',
dataType: 'jsonp', dataType: 'jsonp',
jsonp: 'jsonp', // mongod is expecting the parameter name to be called "jsonp" jsonp: 'jsonp', // mongod is expecting the parameter name to be called "jsonp"
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
console.log('error', errorThrown + " " + textStatus); console.log('error', errorThrown + " " + textStatus);
} }
}); });
}); }
}); jQuery("document").ready(request);
</script> </script>
</head> </head>
<body> <body>
<input type="text" id="search" style="width:100%"/> <form onsubmit="document.location.href = document.location.href.split('#')[0] + '#' + encodeURI($('#search').val()); document.location.reload(); return false;"><input type="text" id="search" style="width:100%" /></form>
<div name="toFill" style="display:none;"> <div name="toFill" style="display:none;">
<a href="" name="link"> <a href="" name="link">
<div style="width:100%; text-align: center; border: solid 1px black; padding: 5px; margin: 3px;"> <div style="width:100%; text-align: center; border: solid 1px black; padding: 5px; margin: 3px;">
......
...@@ -1852,16 +1852,16 @@ ...@@ -1852,16 +1852,16 @@
<p id="spData"> <p id="spData">
</p> </p>
<div style="text-align:center;"><a href="#todo">Lien de tlchargement</a></div> <div style="text-align:center;"><a href="javascript:void()">Lien de tlchargement</a></div>
</div> </div>
<div id="rwData" style="width: 35%; margin-top:0px; float:right;%"> <div id="rwData" style="width: 35%; margin-top:0px; float:right;">
<h2>Tags</h2> <h2>Tags</h2>
</div> </div>
</div> </div>
<div id="preview" style="clear:both"> <div id="preview" style="clear:both">
<div id="introduction" ></div> <div id="introduction" ></div>
<div style="text-align:center;"> <div style="text-align:center;">
<a href="#" onclick="loadFullText()">Lire plus ...</a> <a href="javascript:void()" onclick="loadFullText()">Lire plus ...</a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<xsl:template name="config-main"> <xsl:template name="config-main">
<xsl:param name="fileName"/> <xsl:param name="fileName"/>
<xsl:param name="inputPath"/> <xsl:param name="inputPath"/>
"link" : <xsl:value-of select="h2m:escape-string(document('C:\Users\Kapil\Documents\Projets\github\hdoc\hdoc_to_mongo/input/config.xml')/config/file[@name = $fileName]/link)" />, <xsl:if test="document('../../input/config.xml')/config/file[@name = $fileName]/link">
"link" : <xsl:value-of select="h2m:escape-string(document('../../input/config.xml')/config/file[@name = $fileName]/link)" />,
</xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
\ No newline at end of file
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
xmlns:h2m="http://www.utc.fr/hdoc/hdoc_to_mongo"> xmlns:h2m="http://www.utc.fr/hdoc/hdoc_to_mongo">
<xsl:function name="h2m:escape-string"> <xsl:function name="h2m:escape-string">
<xsl:param name="value"/> <xsl:param name="value"/>
"<xsl:value-of select="replace($value, '&quot;', '\\&quot;')"/>" "<xsl:value-of select="translate(replace($value, '&quot;', '\\&quot;'), '&#13;&#10;&#x9;', ' ')"/>"
</xsl:function> </xsl:function>
</xsl:stylesheet> </xsl:stylesheet>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment